1 import digestx.tiger; 2 import std.string : representation; 3 4 Tiger st; 5 st.start(); 6 st.put("The quick brown fox jumps over the lazy dog".representation); 7 assert(st.finish() == x"6D12A41E72E644F017B6F0E2F7B44C6285F06DD5D2C5B075"); 8 9 // Template API 10 assert(digest!Tiger("abc") == x"2AAB1484E8C158F2BFB8C5FF41B57A525129131C957B5F93"); 11 assert(digest!Tiger160("abc") == x"2AAB1484E8C158F2BFB8C5FF41B57A525129131C"); 12 assert(digest!Tiger128("abc") == x"2AAB1484E8C158F2BFB8C5FF41B57A52"); 13 14 assert(digest!Tiger2("abc") == x"F68D7BC5AF4B43A06E048D7829560D4A9415658BB0B1F3BF"); 15 16 // OOP API 17 Digest t = new TigerDigest; 18 t.put("Tiger".representation); 19 assert(t.finish() == x"DD00230799F5009FEC6DEBC838BB6A27DF2B9D6F110C7937"); 20 21 t = new Tiger160Digest; 22 t.put("Tiger".representation); 23 assert(t.finish() == x"DD00230799F5009FEC6DEBC838BB6A27DF2B9D6F"); 24 25 t = new Tiger128Digest; 26 t.put("Tiger".representation); 27 assert(t.finish() == x"DD00230799F5009FEC6DEBC838BB6A27"); 28 29 t = new Tiger2Digest; 30 t.put("Tiger".representation); 31 assert(t.finish() == x"FE40798B8EB937FD977608930548D6A894C20B04CBEF7A42");
OOP API for Tiger2-128(3 pass)