Back out the thin convenience wrapper hash and hash_hmac. Replacements: Crypto.hash(Crypto.SHA1, true)(x) -> Crypto.SHA1.hash(x) Crypto.hash(Crypto.SHA1) -> sprintf("%x", Crypto.SHA1.hash(x)) Crypto.hash_hmac(Crypto.SHA1,k)(x, true) -> Crypto.SHA1.HMAC(k)(x)
Added some helper methods to Crypto. string md5(string data, void|bool raw) string sha1(string data, void|bool raw) string sha256(string data, void|bool raw) These methods return a hexadecimal string unless `raw` is given. These methods are composed via the helper method `hash()`. string hmac_md5(string secret, string data) string hmac_sha1(string secret, string data) string hmac_sha256(string secret, string data) These methods return a hexadecimal string. These methods are composed via the helper method `hash_hmac()` which can be used to construct new hmac hashing functions.