Created
June 26, 2012 16:00
-
-
Save asinbow/2996682 to your computer and use it in GitHub Desktop.
scala/java get md5 checksum
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
"123".getBytes | |
val md = java.security.MessageDigest.getInstance("MD5") | |
md.update("d123".getBytes) | |
md.digest() | |
val md5 = org.apache.commons.codec.binary.Hex.encodeHex(res) | |
new String(md5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment