murmur3a

Package VersionHex Docs

A nearly pure Gleam implementation of the 32bit Murmur3 hash function1.

gleam add murmur3a
import gleam/io
import murmur3a
pub fn main() {
murmur3a.hash_string("Hello!", 1)
|> murmur3a.hex_digest
|> io.debug
// "DC75D641"
}

API documentation can be found at https://hexdocs.pm/murmur3a.

Development

gleam test # Run the tests

Credits

murmur3a leans heavily on Robin Heggelund Hansen's Elm implementation.

  1. Only two functions rely on JavaScript.