xxhash3

Computes xxHash hashes of arbitrary data. xxHash hashes are either uint32_t, uint64_t or uint128_t quantities that are like a checksum or CRC, but are more robust and very performant.

CategoryFunctions
Template APIXXHTemplate
OOP APIXXH32Digest
Helpersxxh32Of

This module conforms to the APIs defined in std.digest. To understand the differences between the template and the OOP API, see std.digest.

This module publicly imports std.digest and can be used as a stand-alone module.

Public Imports

std.digest
public import std.digest;
Undocumented in source.
std.digest
public import std.digest;
Undocumented in source.

Members

Aliases

XXH128_canonical_t
alias XXH128_canonical_t = ubyte[XXH128_hash_t.sizeof]
Undocumented in source.
XXH32Digest
alias XXH32Digest = WrapperDigest!XXH_32

OOP API XXH implementation. See std.digest for differences between template and OOP API.

XXH32_canonical_t
alias XXH32_canonical_t = ubyte[XXH32_hash_t.sizeof]
Undocumented in source.
XXH32_hash_t
alias XXH32_hash_t = uint
Undocumented in source.
XXH3_128
alias XXH3_128 = XXHTemplate!(XXH128_hash_t, XXH3_state_t, true)
Undocumented in source.
XXH3_128Digest
alias XXH3_128Digest = WrapperDigest!XXH3_128
Undocumented in source.
XXH3_64
alias XXH3_64 = XXHTemplate!(XXH64_hash_t, XXH3_state_t, true)
Undocumented in source.
XXH3_64Digest
alias XXH3_64Digest = WrapperDigest!XXH3_64
Undocumented in source.
XXH3_f_accumulate_512
alias XXH3_f_accumulate_512 = void function(void*, const(void)*, const(void)*) @(safe) pure nothrow @(nogc)
Undocumented in source.
XXH3_f_initCustomSecret
alias XXH3_f_initCustomSecret = void function(void*, ulong) @(safe) pure nothrow @(nogc)
Undocumented in source.
XXH3_f_scrambleAcc
alias XXH3_f_scrambleAcc = void function(void*, const void*) @(safe) pure nothrow @(nogc)
Undocumented in source.
XXH3_hashLong128_f
alias XXH3_hashLong128_f = XXH128_hash_t function(const void*, size_t, XXH64_hash_t, const void*, size_t) @(safe) pure nothrow @(nogc)
Undocumented in source.
XXH3_hashLong64_f
alias XXH3_hashLong64_f = XXH64_hash_t function(const(void)*, size_t, XXH64_hash_t, const(ubyte)*, size_t) @(safe) pure nothrow @(nogc)
Undocumented in source.
XXH64Digest
alias XXH64Digest = WrapperDigest!XXH_64
Undocumented in source.
XXH64_canonical_t
alias XXH64_canonical_t = ubyte[XXH64_hash_t.sizeof]
Undocumented in source.
XXH64_hash_t
alias XXH64_hash_t = ulong
Undocumented in source.
XXH_32
alias XXH_32 = XXHTemplate!(XXH32_hash_t, XXH32_state_t, false)
Undocumented in source.
XXH_64
alias XXH_64 = XXHTemplate!(XXH64_hash_t, XXH64_state_t, false)
Undocumented in source.

Classes

XXHException
class XXHException

Thrown on XXH errors.

Enums

XXH_errorcode
enum XXH_errorcode

The error code of public API functions

Functions

xxh128Of
auto xxh128Of(T data)

This is a convenience alias for std.digest.digest using the XXH implementation.

xxh32Of
auto xxh32Of(T data)
xxh3_64Of
auto xxh3_64Of(T data)
xxh64Of
auto xxh64Of(T data)

This is a convenience alias for std.digest.digest using the XXH implementation.

xxh_get64bits
ulong xxh_get64bits(void* p, XXH_alignment align_)
Undocumented in source. Be warned that the author may not have intended to support it.
xxh_versionNumber
uint xxh_versionNumber()

Get version number

Manifest constants

XXH32_ENDJMP
enum XXH32_ENDJMP;
Undocumented in source.
XXH3_INTERNALBUFFER_SIZE
enum XXH3_INTERNALBUFFER_SIZE;

The size of the internal XXH3 buffer.

XXH3_MIDSIZE_LASTOFFSET
enum XXH3_MIDSIZE_LASTOFFSET;
Undocumented in source.
XXH3_MIDSIZE_MAX
enum XXH3_MIDSIZE_MAX;
Undocumented in source.
XXH3_MIDSIZE_STARTOFFSET
enum XXH3_MIDSIZE_STARTOFFSET;
Undocumented in source.
XXH3_SECRET_DEFAULT_SIZE
enum XXH3_SECRET_DEFAULT_SIZE;
Undocumented in source.
XXH3_SECRET_SIZE_MIN
enum XXH3_SECRET_SIZE_MIN;

The bare minimum size for a custom secret.

XXH3_STREAM_USE_STACK
enum XXH3_STREAM_USE_STACK;
Undocumented in source.
XXH_ACC_ALIGN
enum XXH_ACC_ALIGN;
Undocumented in source.
XXH_ACC_NB
enum XXH_ACC_NB;
Undocumented in source.
XXH_FORCE_ALIGN_CHECK
enum XXH_FORCE_ALIGN_CHECK;
Undocumented in source.
XXH_NO_STREAM
enum XXH_NO_STREAM;
Undocumented in source.
XXH_PREFETCH_DIST
enum XXH_PREFETCH_DIST;
Undocumented in source.
XXH_PRIME32_1
enum XXH_PRIME32_1;

0b10011110001101110111100110110001

XXH_PRIME32_2
enum XXH_PRIME32_2;

0b10000101111010111100101001110111

XXH_PRIME32_3
enum XXH_PRIME32_3;

0b11000010101100101010111000111101

XXH_PRIME32_4
enum XXH_PRIME32_4;

0b00100111110101001110101100101111

XXH_PRIME32_5
enum XXH_PRIME32_5;

0b00010110010101100110011110110001

XXH_PRIME64_1
enum XXH_PRIME64_1;

0b1001111000110111011110011011000110000101111010111100101010000111

XXH_PRIME64_2
enum XXH_PRIME64_2;

0b1100001010110010101011100011110100100111110101001110101101001111

XXH_PRIME64_3
enum XXH_PRIME64_3;

0b0001011001010110011001111011000110011110001101110111100111111001

XXH_PRIME64_4
enum XXH_PRIME64_4;

0b1000010111101011110010100111011111000010101100101010111001100011

XXH_PRIME64_5
enum XXH_PRIME64_5;

0b0010011111010100111010110010111100010110010101100110011111000101

XXH_SECRET_CONSUME_RATE
enum XXH_SECRET_CONSUME_RATE;
Undocumented in source.
XXH_SECRET_DEFAULT_SIZE
enum XXH_SECRET_DEFAULT_SIZE;
Undocumented in source.
XXH_SECRET_LASTACC_START
enum XXH_SECRET_LASTACC_START;
Undocumented in source.
XXH_SECRET_MERGEACCS_START
enum XXH_SECRET_MERGEACCS_START;
Undocumented in source.
XXH_SEC_ALIGN
enum XXH_SEC_ALIGN;
Undocumented in source.
XXH_SIZE_OPT
enum XXH_SIZE_OPT;
Undocumented in source.
XXH_STRIPE_LEN
enum XXH_STRIPE_LEN;
Undocumented in source.
XXH_VERSION_MAJOR
enum XXH_VERSION_MAJOR;

XXHASH Major version

XXH_VERSION_MINOR
enum XXH_VERSION_MINOR;

XXHASH Minor version

XXH_VERSION_NUMBER
enum XXH_VERSION_NUMBER;

Version number, encoded as two digits each

XXH_VERSION_RELEASE
enum XXH_VERSION_RELEASE;

XXHASH Build/Release version

Static variables

XXH3_INIT_ACC
auto XXH3_INIT_ACC;
Undocumented in source.

Structs

XXH128_hash_t
struct XXH128_hash_t

Storage for 128bit hash digest

XXH32_state_t
struct XXH32_state_t

Structure for XXH32 streaming API.

XXH64_state_t
struct XXH64_state_t
Undocumented in source.
XXHTemplate
struct XXHTemplate(HASH, STATE, bool useXXH3)

Template API XXHTemplate implementation. Uses parameters to configure for number of bits and XXH variant (classic or XXH3) See std.digest for differences between template and OOP API.

Variables

xxh3_accumulate_512
XXH3_f_accumulate_512 xxh3_accumulate_512;
Undocumented in source.
xxh3_initCustomSecret
XXH3_f_initCustomSecret xxh3_initCustomSecret;
Undocumented in source.
xxh3_scrambleAcc
XXH3_f_scrambleAcc xxh3_scrambleAcc;
Undocumented in source.

Meta

License

Boost License 1.0.

CTFE: Digests do not work in CTFE

Authors

Carsten Schlote, Piotr Szturmaj, Kai Nacke, Johannes Pfau
The routines and algorithms are provided by the xxhash.ch source provided at git@github.com:Cyan4973/xxHash.git.

References: GitHub website of project