Skip to content

Instantly share code, notes, and snippets.

View fernandoacorreia's full-sized avatar

Fernando Correia fernandoacorreia

  • San Francisco, CA
  • 20:03 (UTC -07:00)
View GitHub Profile
@stonegao
stonegao / gist:1044641
Created June 24, 2011 11:59 — forked from leifwickland/gist:1013460
MD5 in scala
object MD5 {
def hash(s: String) = {
val m = java.security.MessageDigest.getInstance("MD5")
val b = s.getBytes("UTF-8")
m.update(b, 0, b.length)
new java.math.BigInteger(1, m.digest()).toString(16)
}
}