WhirlpoolDigest

OOP API for Whirlpool

alias WhirlpoolDigest = WrapperDigest!Whirlpool

Examples

import nxt.digest.whirlpool;

ubyte[1024] data;
Whirlpool wp;
wp.start();
wp.put(data[]);
wp.start();
wp.put(data[]);
ubyte[64] hash = wp.finish();

// Template API

ubyte[64] hash2 = whirlpoolOf("abc");
assert(digest!Whirlpool("abc") == hash2);
assert(hexDigest!Whirlpool("abc") == toHexString(hash2));

// OOP API

Digest wpDigest = new WhirlpoolDigest;
ubyte[] hash3 = wpDigest.digest("abc");
assert(toHexString(hash3) == "4E2448A4C6F486BB16B6562C73B4020BF3043E3A731BCE721AE1B303D97E6D4C"
	   ~ "7181EEBDB6C57E277D0E34957114CBD6C797FC9D95D8B582D225292076D4EEF5");

Meta