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; }
DZone Snippets > whitetiger > hash
12388 users tagging and storing useful source code snippets
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
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; }