Examples:
__gshared immutable immutable(char)[][] strings =
[
"abc",
"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq",
"a",
"0123456701234567012345670123456701234567012345670123456701234567"
];
__gshared immutable immutable(char)[][] results =
[
"a9993e364706816aba3e25717850c26c9cd0d89d",
"84983e441c3bd26ebaae4aa1f95129e5e54670f1",
"34aa973cd4c4daa4f61eeb2bdbad27316534016f",
"dea356a2cddd90c7a7ecedc5ebb563934f460452"
];
__gshared immutable int[] repeat =
[
1,
1,
1000000,
10
];
Sha1 h = new Sha1();
foreach (int i, immutable(char)[] s; strings)
{
for(int r = 0; r < repeat[i]; r++)
h.update(s);
char[] d = h.hexDigest();
assert(d == results[i],":("~s~")("~d~")!=("~results[i]~")");
}
- this();
- Construct a Sha1 hash algorithm context
- protected final void transform(const(ubyte[]) input);
- Performs the cipher on a block of data
Params:
data |
the block of data to cipher |
Remarks:
The actual cipher algorithm is carried out by this method on
the passed block of data. This method is called for every
blockSize() bytes of input data and once more with the remaining
data padded to blockSize().
- static void expand(uint[] W, uint s);