A reference to the digest for convenient chaining.
import std.digest.sha : SHA1; import std.string : representation; string data1 = "Hello, world", data2 = "Hola mundo"; auto hmac = HMAC!SHA1("My s3cR3T keY".representation); hmac.put(data1.representation); hmac.start(); // reset digest hmac.put(data2.representation); // start over static immutable expected = [ 122, 151, 232, 240, 249, 80, 19, 178, 186, 77, 110, 23, 208, 52, 11, 88, 34, 151, 192, 255]; assert(hmac.finish() == expected);
Reinitializes the digest, making it ready for reuse.
Note: The constructor leaves the digest in an initialized state, so that this method only needs to be called if an unfinished digest is to be reused.