Created
June 4, 2017 07:31
-
-
Save pantos27/2d458f18e031ba6672dc0bf072419322 to your computer and use it in GitHub Desktop.
hash a string with MD5 in Java with MessageDigest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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