WhirlpoolDigest

OOP API for Whirlpool

alias WhirlpoolDigest = WrapperDigest!Whirlpool

Examples

1 import nxt.digestx.whirlpool;
2 
3 ubyte[1024] data;
4 Whirlpool wp;
5 wp.start();
6 wp.put(data[]);
7 wp.start();
8 wp.put(data[]);
9 ubyte[64] hash = wp.finish();
10 
11 // Template API
12 
13 ubyte[64] hash2 = whirlpoolOf("abc");
14 assert(digest!Whirlpool("abc") == hash2);
15 assert(hexDigest!Whirlpool("abc") == toHexString(hash2));
16 
17 // OOP API
18 
19 Digest wpDigest = new WhirlpoolDigest;
20 ubyte[] hash3 = wpDigest.digest("abc");
21 assert(toHexString(hash3) == "4E2448A4C6F486BB16B6562C73B4020BF3043E3A731BCE721AE1B303D97E6D4C"
22        ~ "7181EEBDB6C57E277D0E34957114CBD6C797FC9D95D8B582D225292076D4EEF5");

Meta