>Everytime I need to use the Crypto module, a great wave of anxiety sweeps over >me. For most common programmers the case is usually that you need to MD5 or >SHA256 som some data to send over HTTP to some REST API or something like >that, or compare something to a hash stored in a database or something like >that. > >I had to make HMAC-SHA256 hash yesterday and it took me like 1,5 hours to >figure that stuff out: > >String.string2hex(Crypto.HMAC(Crypto.SHA256)(secret)(data)); >
The applications of the lower layer crypto is inherited into the implementations. I would do String.string2hex(Crypto.SHA256.HMAC(secret)(data)); http://pike.lysator.liu.se/generated/manual/modref/ex/predef_3A_3A/Crypto/Hash.html
