Branch: Tag:

2017-12-06

2017-12-06 14:38:17 by Martin Nilsson <nilsson@fastmail.com>

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)

2017-10-17

2017-10-17 11:33:44 by Pontus Östlund <ponost@roxen.com>

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.