Java MD5 String md5(String src)

Here you can find the source of md5(String src)

Description

md

License

Apache License

Declaration

public static byte[] md5(String src) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.security.MessageDigest;

public class Main {
    public static byte[] md5(String src) {
        try {/*w  w  w  .ja  v a 2 s .  c om*/
            MessageDigest md5 = MessageDigest.getInstance("MD5");
            byte[] md = md5.digest(src.getBytes());
            return md;
        } catch (Exception e) {
        }
        return null;
    }

    public static byte[] md5(byte[] src) {
        try {
            MessageDigest md5 = MessageDigest.getInstance("MD5");
            byte[] md = md5.digest(src);
            return md;
        } catch (Exception e) {
        }
        return null;
    }
}

Related

  1. md5(String source, int bit)
  2. MD5(String sourceStr)
  3. MD5(String src)
  4. md5(String src)
  5. md5(String src)
  6. md5(String srcStr)
  7. md5(String str)
  8. md5(String str)
  9. MD5(String str)