hashImpl

used for create keccak family functions

pure nothrow @safe @nogc
int
hashImpl
(
ubyte delim
ulong bits
bool checkSize = true
)
(
ubyte[] dst
,
const(ubyte)[] src
)

Parameters

dst ubyte[]

destination for hash result

src const(ubyte)[]

value used for hash

Return Value

Type: int

error code -1 if failed

Examples

ubyte[5] source = [0xff, 0xa1, 0x12, 0x22, 0xff];
ubyte[256 / 8] result;
ubyte[256 / 8] result2;
assert(hashImpl!(0x01, 256)(result[], source[]) == 0);
assert(keccakImpl!(256)(result2[], source[]) == 0);
assert(result[] == result2[]);

Meta