folly::hash

Hashing algorithms and helpers.

Namespaces

NameDescription
farmhash FarmHash hashing and fingerprinting functions imported from the bundled external implementation.

Types

NameDescription
SpookyHashV1 SpookyHash V1: a 128-bit noncryptographic hash function by Bob Jenkins.
SpookyHashV2 SpookyHash V2: a 128-bit noncryptographic hash function by Bob Jenkins.
StdHasher Hasher that forwards to std::hash for each key type.

Functions

NameDescription
commutative_hash_128_to_64 Order-independent reduction of two 64-bit hashes into one.
commutative_hash_combine Combine hashes of multiple items, order-independently.
commutative_hash_combine_generic Combine hashes of multiple items, order-independently.
commutative_hash_combine_range Create a hash from multiple hashable objects, order-independently.
commutative_hash_combine_range_generic Create a hash from multiple hashable objects, order-independently.
commutative_hash_combine_value_generic Hash a value, and combine it with a seed. Commutative.
fnv32 Alias for fnv32_BROKEN.
fnv32_BROKEN fnv32_BROKEN overloads
fnv32_FIXED fnv32_FIXED overloads
fnv32_append_byte Alias for fnv32_append_byte_BROKEN.
fnv32_append_byte_BROKEN Append byte to FNV hash.
fnv32_append_byte_FIXED Append byte to FNV hash.
fnv32_buf fnv32_buf overloads
fnv32_buf_BROKEN fnv32_buf_BROKEN overloads
fnv32_buf_FIXED fnv32_buf_FIXED overloads
fnv64 Alias for fnv64_BROKEN.
fnv64_BROKEN fnv64_BROKEN overloads
fnv64_FIXED fnv64_FIXED overloads
fnv64_append_byte Alias for fnv64_append_byte_BROKEN.
fnv64_append_byte_BROKEN Append a byte to FNV hash.
fnv64_append_byte_FIXED Append a byte to FNV hash.
fnv64_buf fnv64_buf overloads
fnv64_buf_BROKEN fnv64_buf_BROKEN overloads
fnv64_buf_FIXED fnv64_buf_FIXED overloads
fnva32 FNVA hash of a string.
fnva32_append_byte Append a byte to FNVA hash.
fnva32_buf fnva32_buf overloads
fnva64 FNVA hash of a string.
fnva64_append_byte Append a byte to FNVA hash.
fnva64_buf fnva64_buf overloads
hash_128_to_64 Reduce two 64-bit hashes into one.
hash_combine Combine hashes of multiple items, order-dependently.
hash_combine_generic hash_combine_generic overloads
hash_range Combine hashes of items in the range [first, last), order-dependently.]
hsieh_hash32 hsieh hash a c-str.
hsieh_hash32_buf hsieh hash a void* byte-range.
hsieh_hash32_buf_constexpr hsieh hash a byte-range.
hsieh_hash32_str hsieh hash a string.
jenkins_rev_mix32 Robert Jenkins' reversible 32 bit mix hash function.
jenkins_rev_unmix32 Inverse of jenkins_rev_mix32.
lowbias_mix32 Low-bias 32 bit mix function.
lowbias_unmix32 Inverse of lowbias_mix32.
moremur_mix64 Pelle Evensen's moremur 64 bit mix function.
moremur_unmix64 Inverse of moremur_mix64.
murmurHash64 Implementation of MurmurHash2 hashing algorithm for 64-bit platforms.
stdCompatibleHash Hash a string view compatibly with std::hash, using a faster murmur-based hash where available.
twang_32from64 Thomas Wang downscaling hash function.
twang_mix64 Thomas Wang 64 bit mix hash function.
twang_unmix64 Inverse of twang_mix64.

Variables

NameDescription
fnv32_hash_start FNV-1 32-bit offset-basis seed, the starting value for 32-bit FNV hashing.
fnv64_hash_start FNV-1 64-bit offset-basis seed, the starting value for 64-bit FNV hashing.
fnva32_hash_start FNV-1a 32-bit offset-basis seed, the starting value for 32-bit FNV-1a hashing.
fnva64_hash_start FNV-1a 64-bit offset-basis seed, the starting value for 64-bit FNV-1a hashing.

Using Declarations

NameDescription
rapidhash Hash a byte buffer with rapidhash, uint64_t rapidhash(const char* key, size_t len).
rapidhashMicro Hash a byte buffer with the rapidhashMicro variant, uint64_t rapidhashMicro(const char* key, size_t len).
rapidhashMicro_with_seed Hash a byte buffer with rapidhashMicro and an explicit seed, uint64_t rapidhashMicro_with_seed(const char* key, size_t len, uint64_t seed).
rapidhashNano Hash a byte buffer with the rapidhashNano variant, uint64_t rapidhashNano(const char* key, size_t len).
rapidhashNano_with_seed Hash a byte buffer with rapidhashNano and an explicit seed, uint64_t rapidhashNano_with_seed(const char* key, size_t len, uint64_t seed).
rapidhash_with_seed Hash a byte buffer with rapidhash and an explicit seed, uint64_t rapidhash_with_seed(const char* key, size_t len, uint64_t seed).