hash

used for create keccak family functions

More...
pure nothrow @trusted @nogc
int
hash
(
ubyte delim
ulong bits
bool checkSize = true
)
(
ubyte* dst
,
ulong outlen
,
ubyte* src
,
ulong inlen
)

Parameters

dst ubyte*

destination for hash result

outlen ulong

hash size wanted

src ubyte*

value used for hash

inlen ulong

size of value

Return Value

Type: int

error code -1 if failed

Detailed Description

Deprecated: use hashImpl instead

Examples

ubyte[5] source = [0xff, 0xa1, 0x12, 0x22, 0xff];
ubyte[256 / 8] result;
ubyte[256 / 8] result2;
assert(hash!(0x01, 256)(result.ptr, result.length, source.ptr, source.length) == 0);
assert(keccak!(256)(result2.ptr, result2.length, source.ptr, source.length) == 0);
assert(result[] == result2[]);

Meta