murmurhash

Pure nim implementation of MurmurHash

Pure Nim score 30/100 · tests present · docs generated

Summary

Latest Version Unknown
License MIT
CI Status Failing
Downloads 0
Last Indexed 2026-07-21 05:24

Installation

nimble install murmurhash
choosenim install murmurhash
git clone https://github.com/cwpearson/nim-murmurhash

OS Compatibility

Platform Linux macOS Windows FreeBSD OpenBSD NetBSD Android iOS WASM Embedded
murmurhash - - - - - - -

Source

Repository https://github.com/cwpearson/nim-murmurhash
Homepage https://github.com/cwpearson/nim-murmurhash
Documentation View Documentation
Registry Source nimble_official

README

nim-murmur

Build Status

A pure-nim implementation of MurmurHash. Has MurmurHash3 and MurmurHash2, and does not wrap a C implementation.

Adapted from https://github.com/aappleby/smhasher

Using

This is in the nimble package manager as murmurhash, so you can put

requires murmurhash>=0.4.0

in your nimble file. Or, to pin to a particuar commit, do

requires "https://github.com/cwpearson/nim-murmurhash#b44ed52"

then,

import murmurhash

About

Only two functions implemented currently.

  • Murmur3
  • [x] MurmurHash3_x64_128
  • [ ] MurmurHash3_x86_32
  • [ ] MurmurHash3_x86_128
  • Murmur2
  • [x] MurmurHash64A - The original 64-bit version. Optimized for 64-bit arithmetic.
  • [ ] MurmurHash2 - The original version; contains a flaw that weakens collision in some cases.
  • [ ] MurmurHash2A - A fixed variant using Merkle–Damgård construction construction. Slightly slower.
  • [ ] CMurmurHash2A - MurmurHash2A but works incrementally.
  • [ ] MurmurHashNeutral2 - Slower, but endian and alignment neutral.
  • [ ] MurmurHashAligned2 - Slower, but does aligned reads (safer on some platforms).
  • [ ] MurmurHash64B (64-bit, x86) - A 64-bit version optimized for 32-bit platforms. Unfortunately it is not a true 64-bit hash due to insufficient mixing of the stripes.
  • Murmur
  • [ ] MurmurHash1

Related:

  • nimble murmur package https://github.com/olahol/nimrod-murmur/. Doesn't have Murmur3 or Murmur2.
  • vitanim by timotheecour. Pure nim murmur3 only. Not set up as a package.
  • nimble murmur3 package https://github.com/boydgreenfield/nimrod-murmur. Wraps a c implementation.