Skip to content

Instantly share code, notes, and snippets.

@pantos27
Created June 4, 2017 07:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pantos27/2d458f18e031ba6672dc0bf072419322 to your computer and use it in GitHub Desktop.
Save pantos27/2d458f18e031ba6672dc0bf072419322 to your computer and use it in GitHub Desktop.
hash a string with MD5 in Java with MessageDigest
final MessageDigest md5 = MessageDigest.getInstance("MD5");
final byte[] digest = md5.digest(text.getBytes());
String hash = new String(digest);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment