Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/cwpearson/nim-murmurhash

Pure-nim MurmurHash implementation
https://github.com/cwpearson/nim-murmurhash

Last synced: 2 months ago
JSON representation

Pure-nim MurmurHash implementation

Awesome Lists containing this project

README

        

# nim-murmur

[![Build Status](https://travis-ci.org/cwpearson/nim-murmurhash.svg?branch=master)](https://travis-ci.org/cwpearson/nim-murmurhash)

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,

```nim
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](https://github.com/timotheecour/vitanim/blob/master/murmur/murmur.nim) 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.