3zcurdia / murmur3

Wrapper for Murmur3 rust library

Home Page:https://hex.pm/packages/murmur3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Murmur3

Hex docs Hex Version License

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.

Installation

Add Murmur as a dependency in your mix.exs file.

def deps do
  [
    {:murmur3, "~> 0.1.0"}
  ]
end

Usage

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}

License

This project is licensed under the MIT License - see the LICENSE file for details

About

Wrapper for Murmur3 rust library

https://hex.pm/packages/murmur3

License:MIT License


Languages

Language:Elixir 89.7%Language:Rust 10.3%