//Base64 encoding/decoding functions facilities def EncodeBase64( email: String ): String = org.apache.commons.codec.binary.Base64.encodeBase64String( email.getBytes ) def DecodeBase64( encodedUusername: String ): String = new String( org.apache.commons.codec.binary.Base64.decodeBase64( encodedUusername ) ) import org.apache.commons.codec.digest.DigestUtils._ //Calculates the SHA-256 digest and returns the value as a hex string. val dataInSha1 = sha256Hex( dataToCrypt ) val dataInMd5 = md5( dataToCrypt ) //see http://commons.apache.org/codec/api-release/org/apache/commons/codec/digest/DigestUtils.html