Sample code for java.security.MessageDigest, written in Scala