Skip to content

Instantly share code, notes, and snippets.

View kshep92's full-sized avatar

Kevin kshep92

  • Trinidad and Tobago
View GitHub Profile
@kshep92
kshep92 / md5.groovy
Created February 24, 2017 02:52 — forked from ikarius/md5.groovy
How to generate a MD5 hash in Groovy ...
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()}"