CardHashInterface - lcrocker/ojpoker GitHub Wiki
CardHashInterface
This interface (CardHashTrait
in Rust) describes a family of related
hash functions grouped into a single class with static functions.
All of the functions take an iterable of cards, which must terminate.
Many of the functions have limitations described in their respective pages.
The name of the function describes some basic attributes of the hash:
- u32() General-purpose 32-bit hash with possible collisions.
- u64() General-purpose 64-bit hash with possible collisions.
- u32c() 32-bit hash, collision-free if size limit is respected.
- u64c() 64-bit hash, ''
- u32co() 32-bit hash, collision-free, order-independent (hands with same cards in different order hash equal)
- u64co() 64-bit hash, ''
- u32cos() 32-bit hash, collision-free, order-independent, suit-independent
- u64cos() 64-bit hash, ''
Implementations
FNVHash · PositionalHash · BitfieldHash · PrimeHash