XxHash32

Namespace: SnowBank.IO.Hashing · class

Computes a 32-bit xxHash

Remarks

IMPORTANT: This hash is NOT cryptographic! It can leak information about the hashed data, and must therefore not be used publicly in a data-protection scenario! (you should rather use SHA or HMAC for that kind of thing)

Methods

Compute

static uint Compute(string text)

Computes the 32-bit xxHash of a string (from its in-memory UTF-16 representation)

  • text — Text string to convert

Returns: 32-bit xxHash code computed over the UTF-16 representation of the string. Warning: Not guaranteed to be unique!

static uint Compute(byte[] input)

static uint Compute(Slice buffer)

static uint Compute(ReadOnlySpan<byte> buffer)

static uint Compute(Byte* input, uint len)

static ulong Compute(string text, int offset, int count)

static uint Compute(char[] buffer, int offset, int count)

Computes the 32-bit xxHash of a string (from its in-memory UTF-16 representation)

Returns: 32-bit xxHash code computed over the UTF-16 representation of the string. Warning: Not guaranteed to be unique!

static uint Compute(byte[] input, int offset, int len)

Continue

static uint Continue(uint seed, byte[] input)

static uint Continue(uint seed, Slice buffer)

static uint Continue(uint seed, ReadOnlySpan<byte> buffer)

static uint Continue(uint seed, byte[] input, int offset, int len)

ContinueUnsafe

static uint ContinueUnsafe(uint seed, Byte* input, uint len)

Fields

HASH0

const uint HASH0

Hash of the empty buffer