Wrapper for Murmur3 rust library. MurmurHash is a non-cryptographic hash function suitable for general hash-based lookup.
It mplements the version 3 with ther three main variants x86_32bit, x86_128bit and x64_128bit.
Add Murmur as a dependency in your mix.exs file.
def deps do
[
{:murmur3, "~> 0.1.0"}
]
end
To generate a hash for a string, use the murmur3_x86_32
function.
iex> Murmur3.murmur3_x86_32("hello world", 0)
{:ok, 1586663183}
To generate a hash for the x86_128 variant, use the murmur3_x86_128
function.
iex> Murmur3.murmur3_x86_128("hello world", 0)
{:ok, 206095855024402301784664199839047883400}
To generate a hash for the x64_128 variant, use the murmur3_x64_128
function.
iex> Murmur3.murmur3_x64_128("hello world", 0)
{:ok, 228083453807047072434243676435732455694}
This project is licensed under the MIT License - see the LICENSE file for details