Cascade
Loading...
Searching...
No Matches
Buzzware.Cascade.FNVHash Class Reference

FNVHash provides methods for generating hash values using the Fowler-Noll-Vo hashing algorithm. It is chosen for its speed (10-100X SHA-256) and low collision rate. It supports generating hash values of varying bit lengths. FNV is not a cryptographic hash. More...

Static Public Member Functions

static ulong GetHash (string? aString, int aHashBits)
 Generates a hash value for a given string using a specified bit length. This method utilizes the FNV hashing algorithm and supports 32-bit and 64-bit hashing.

Detailed Description

FNVHash provides methods for generating hash values using the Fowler-Noll-Vo hashing algorithm. It is chosen for its speed (10-100X SHA-256) and low collision rate. It supports generating hash values of varying bit lengths. FNV is not a cryptographic hash.

Member Function Documentation

◆ GetHash()

ulong Buzzware.Cascade.FNVHash.GetHash ( string? aString,
int aHashBits )
inlinestatic

Generates a hash value for a given string using a specified bit length. This method utilizes the FNV hashing algorithm and supports 32-bit and 64-bit hashing.

Parameters
aStringThe input string to hash.
aHashBitsThe bit length of the hash
Returns
Hash value of specified bit length.
Exceptions
ArgumentOutOfRangeExceptionThrown when an invalid bit size is provided.

The documentation for this class was generated from the following file:
  • Buzzware.Cascade/utilities/FNVHash.cs