erl_hash is an Erlang library providing a collection of high-performance hash algorithms not included in the standard Erlang libraries.
It is designed for both compatibility with existing systems and easy integration for new projects.
| Function | Description |
|---|---|
murmur3_x64_128_legacy |
Returns the top 32 bits of the 128-bit hash. Compatible with VoltDB-style consistent hashing. |
murmur3_x64_128_bin |
Returns the full 128-bit hash as a 16-byte binary buffer. |
murmur3_x64_128_hex |
Returns the full 128-bit hash as a 32-character hexadecimal string. |
murmur2– standard 32-bit Murmur2 hash implementation.
| Function | Description |
|---|---|
fnv1_32 |
FNV-1 32-bit hash |
fnv1a_32 |
FNV-1a 32-bit hash |
fnv1_64 |
FNV-1 64-bit hash |
fnv1a_64 |
FNV-1a 64-bit hash |
| Function | Description |
|---|---|
xxhash_32 |
32-bit XXHash |
xxhash_64 |
64-bit XXHash |
xxhash_128 |
128-bit XXHash (binary) |
xxhash_128_hex |
128-bit XXHash (32-character hexadecimal string) |
To compile the project, simply run:
rebar3 compileerl_hash:murmur3_x64_128_legacy(<<"hello">>, 0).
-874993741
erl_hash:murmur3_x64_128_bin(<<"hello">>, 0).
<<203,216,167,179,65,189,155,2,91,30,144,106,72,174,29,25>>
erl_hash:murmur3_x64_128_hex(<<"hello">>, 0).
<<"cbd8a7b341bd9b025b1e906a48ae1d19">>