Created
June 9, 2016 18:18
-
-
Save aviskase/68354ab2731b4e1ab2eea7d0cf7bb673 to your computer and use it in GitHub Desktop.
Calculate MD5 in Base64
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
import java.security.MessageDigest | |
sometext = "123 Document.txt 123" | |
MessageDigest md = MessageDigest.getInstance("MD5") | |
md.update(sometext.getBytes()) | |
byte[] enc = md.digest() | |
String md5Sum = new sun.misc.BASE64Encoder().encode(enc) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment