XXH3_128Digest

Undocumented in source.
alias XXH3_128Digest = WrapperDigest!XXH3_128

Examples

//Simple example, hashing a string using Digest.digest helper function
auto xxh = new XXH32Digest();
ubyte[] hash = xxh.digest("abc");
//Let's get a hash string
assert(toHexString(hash) == "32D153FF");
//Simple example, hashing a string using Digest.digest helper function
auto xxh = new XXH64Digest();
ubyte[] hash = xxh.digest("abc");
//Let's get a hash string
assert(toHexString(hash) == "44BC2CF5AD770999");
//Simple example, hashing a string using Digest.digest helper function
auto xxh = new XXH3_64Digest();
ubyte[] hash = xxh.digest("abc");
//Let's get a hash string
assert(toHexString(hash) == "78AF5F94892F3950");
//Simple example, hashing a string using Digest.digest helper function
auto xxh = new XXH3_128Digest();
ubyte[] hash = xxh.digest("abc");
//Let's get a hash string
assert(toHexString(hash) == "06B05AB6733A618578AF5F94892F3950");
//Let's use the OOP features:
void test(Digest dig)
{
    dig.put(cast(ubyte) 0);
}

auto xxh = new XXH32Digest();
test(xxh);

//Let's use a custom buffer:
ubyte[16] buf;
ubyte[] result = xxh.finish(buf[]);
assert(toHexString(result) == "CF65B03E", "Got " ~ toHexString(result));
//Let's use the OOP features:
void test(Digest dig)
{
    dig.put(cast(ubyte) 0);
}

auto xxh = new XXH64Digest();
test(xxh);

//Let's use a custom buffer:
ubyte[16] buf;
ubyte[] result = xxh.finish(buf[]);
assert(toHexString(result) == "E934A84ADB052768", "Got " ~ toHexString(result));
//Let's use the OOP features:
void test(Digest dig)
{
    dig.put(cast(ubyte) 0);
}

auto xxh = new XXH3_64Digest();
test(xxh);

//Let's use a custom buffer:
ubyte[16] buf;
ubyte[] result = xxh.finish(buf[]);
assert(toHexString(result) == "C44BDFF4074EECDB", "Got " ~ toHexString(result));
//Let's use the OOP features:
void test(Digest dig)
{
    dig.put(cast(ubyte) 0);
}

auto xxh = new XXH3_128Digest();
test(xxh);

//Let's use a custom buffer:
ubyte[16] buf;
ubyte[] result = xxh.finish(buf[]);
assert(toHexString(result) == "A6CD5E9392000F6AC44BDFF4074EECDB", "Got " ~ toHexString(result));

Meta