std.digest: can we get rid of start() functions?

Piotr Szturmaj bncrbme at jadamspam.pl
Wed Oct 10 03:55:59 PDT 2012


And replace them with global reset function:

void reset(T)(ref T digest)
     if (isDigest!T)
{
     digest = T.init;
}

Current usage:

SHA1 sha1;
sha1.start();
... calculate hash
sha1.start(); // start again
... calculate hash

New usage:

SHA1 sha1;
... calculate hash
sha1.reset(); // start egain
... calculate hash


More information about the Digitalmars-d mailing list