-
-
Save kshep92/92f0864cc9a4c1a0bf380890a2a899f0 to your computer and use it in GitHub Desktop.
How to generate a MD5 hash in Groovy ...
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 | |
String fileContents = "<html><head></head><body>Hello world!</body></html>" | |
MessageDigest sha = MessageDigest.getInstance("MD5") | |
byte[] digest = sha.digest(fileContents.bytes) | |
print "${digest.encodeHex()}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment