Construct an Sha0
The digest size of Sha-0 and Sha-1 is 20 bytes
Initialize the cipher
Obtain the digest
To be implemented
block size
Length padding size
Pads the cipher data
Performs the length padding
static istring[] strings = [ "", "abc", "message digest", "abcdefghijklmnopqrstuvwxyz", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789", "12345678901234567890123456789012345678901234567890123456789012345678901234567890" ]; static istring[] results = [ "f96cea198ad1dd5617ac084a3d92c6107708c0ef", "0164b8a914cd2a5e74c4f7ff082c4d97f1edf880", "c1b0f222d150ebb9aa36a40cafdc8bcbed830b14", "b40ce07a430cfd3c033039b9fe9afec95dc1bdcd", "79e966f7a3a990df33e40e3d7f8f18d2caebadfa", "4aa29d14d171522ece47bee8957e35a41f3e9cff", ]; Sha0 h = new Sha0(); foreach (i, s; strings) { h.update(s); char[] d = h.hexDigest(); test(d == results[i],":("~s~")("~d~")!=("~results[i]~")"); }