Skip to main content

XXHash

A class in Root.Township, the global namespace.

Seeded 32-bit xxHash, a HashFunction. Cave generation uses it to get repeatable values from a world seed.

Constructors​

MemberWhat it is
XXHash(int seed)Creates a XXHash from seed.

Fields​

6 private and internal fields
MemberWhat it is
private const uint PRIME32_1xxHash32 prime constant.
private const uint PRIME32_2xxHash32 prime constant.
private const uint PRIME32_3xxHash32 prime constant.
private const uint PRIME32_4xxHash32 prime constant.
private const uint PRIME32_5xxHash32 prime constant.
private uint seedSeed mixed into every hash.

Methods​

MemberWhat it is
uint GetHash(byte[] buf)Hashes a byte array, a uint or int array, or a single int, mixed with the seed.
uint GetHash(params uint[] buf)Hashes a byte array, a uint or int array, or a single int, mixed with the seed.
override uint GetHash(params int[] buf)Hashes a byte array, a uint or int array, or a single int, mixed with the seed.
override uint GetHash(int buf)Hashes a byte array, a uint or int array, or a single int, mixed with the seed.
3 private and internal methods
MemberWhat it is
private static uint CalcSubHash(uint value, byte[] buf, int index)One xxHash lane round on 4 bytes or one uint.
private static uint CalcSubHash(uint value, uint read_value)One xxHash lane round on 4 bytes or one uint.
private static uint RotateLeft(uint value, int count)32-bit rotate left.