Over a million developers have joined DZone.

Java - String2MD5

·

public static byte[] getKeyedDigest(byte[] buffer, byte[] key) {
   try {
      MessageDigest md5 = MessageDigest.getInstance("MD5");
      md5.update(buffer);
      return md5.digest(key);
   } catch (NoSuchAlgorithmException nsae) {}

   return null;
}
Topics:

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}