Murmurhash3 for Lua
Switch branches/tags
Clone or download
Latest commit bc4ec3f Mar 6, 2016
Permalink
Failed to load latest commit information.
.gitignore v1.2 Jan 26, 2015
LICENSE Initial commit Jan 20, 2015
README.md v1.2 Jan 26, 2015
example.lua Added README.md Jan 22, 2015
lmurmurhash3.c v1.3 Mar 6, 2016
murmurhash3-1.3-0.rockspec v1.3 Mar 6, 2016

README.md

murmurhash3

Murmurhash 3 for Lua

##Installation

$ sudo luarocks install --server=http://rocks.moonscript.org murmurhash3

Or build it manually:

gcc -O2 -fPIC -I/usr/include/lua5.1 -c lmurmurhash3.c -o lmurmurhash3.o
gcc -shared -o murmurhash3.so -L/usr/local/lib lmurmurhash3.o

Usage

local mmh3 = require "murmurhash3"

local seed = 0 -- (optional)
local data = "payload"

local hash = mmh3.hash32(data, seed)
local raw = mmh3.hash32(data, seed, true)

-- hash: 1120944743
-- raw: (4 byte)

License

Public domain