The final HMAC hash.
import std.algorithm.iteration : map; import std.digest.sha : SHA1; import std.string : representation; string data = "Hello, world"; auto digest = data.representation .map!(a => cast(ubyte)(a+1)) .hmac!SHA1("My s3cR3T keY".representation); static assert(is(typeof(digest) == ubyte[20])); static immutable expected = [ 163, 208, 118, 179, 216, 93, 17, 10, 84, 200, 87, 104, 244, 111, 136, 214, 167, 210, 58, 10]; assert(digest == expected);
Computes an HMAC digest over the given range of data with the specified secret.