Skip to content

Instantly share code, notes, and snippets.

@aviskase
Created June 9, 2016 18:18
Show Gist options
  • Save aviskase/68354ab2731b4e1ab2eea7d0cf7bb673 to your computer and use it in GitHub Desktop.
Save aviskase/68354ab2731b4e1ab2eea7d0cf7bb673 to your computer and use it in GitHub Desktop.
Calculate MD5 in Base64
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