Packages

32 bit variant of the Murmur3 non-cryptographic hash function

Current section

Files

Jump to
murmur3a README.md
Raw

README.md

# murmur3a
[![Package Version](https://img.shields.io/hexpm/v/murmur3a)](https://hex.pm/packages/murmur3a)
[![Hex Docs](https://img.shields.io/badge/hex-docs-ffaff3)](https://hexdocs.pm/murmur3a/)
![Erlang-compatible](https://img.shields.io/badge/target-erlang-b83998)
![JavaScript-compatible](https://img.shields.io/badge/target-javascript-f1e05a)
A pure Gleam implementation of the 32bit Murmur3 non-cryptographic hash function (with a little
JavaScript optimisation).
```sh
gleam add murmur3a
```
```gleam
import gleam/io
import murmur3a
pub fn main() {
murmur3a.hash_string("Hello!", 1)
|> murmur3a.hex_digest
// -> "DC75D641"
}
```
API documentation can be found at <https://hexdocs.pm/murmur3a>.
## Development
```sh
gleam test # Run the tests with erlang
gleam test --target javascript # Run the tests with bun
```
## Credits
murmur3a leans heavily on Robin Heggelund Hansen's [Elm implementation](https://github.com/robinheghan/murmur3/).