Encrypt password.

This commit is contained in:
takezoe
2013-06-29 15:13:20 +09:00
parent cd2486344f
commit 10f2cbbc3e
5 changed files with 39 additions and 23 deletions

View File

@@ -0,0 +1,11 @@
package util
object StringUtil {
def encrypt(value: String): String = {
val md = java.security.MessageDigest.getInstance("SHA-1")
md.update(value.getBytes)
md.digest.map(b => "%02x".format(b)).mkString
}
}