murmur

package module
v0.0.0-...-b9740d7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 19, 2015 License: MIT Imports: 1 Imported by: 30

README

go-murmur

Go programming language implementation of MurmurHash2, based on the work by Austin Appleby.

Performance

Looks roughly something like this:

BenchmarkMurmurHash2     50000000   31.6 ns/op
BenchmarkMurmurHash2A    50000000   35.3 ns/op
BenchmarkMurmurHash64A   100000000  26.7 ns/op
BenchmarkHash32_Murmur2  10000000   197 ns/op
BenchmarkHash32_FNV1     10000000   155 ns/op
BenchmarkHash32_FNV1a    10000000   156 ns/op

Caveats

Always test code to make sure that it works as intended. Please submit pull requests if you find anything amiss.

License

MIT

Documentation

Overview

Based on the MurmurHash2.cpp source from SMHasher & MurmurHash, https://code.google.com/p/smhasher/

Index

Constants

View Source
const (
	M     = 0x5bd1e995
	BIG_M = 0xc6a4a7935bd1e995
	R     = 24
	BIG_R = 47
)

Mixing constants; generated offline.

Variables

This section is empty.

Functions

func MurmurHash2

func MurmurHash2(data []byte, seed uint32) (h uint32)

The original MurmurHash2 32-bit algorithm by Austin Appleby.

func MurmurHash2A

func MurmurHash2A(data []byte, seed uint32) (h uint32)

MurmurHash2A (32-bit) algorithm by Austin Appleby.

func MurmurHash64A

func MurmurHash64A(data []byte, seed uint64) (h uint64)

MurmurHash64A (64-bit) algorithm by Austin Appleby.

func New32

func New32(seed uint32) hash.Hash32

New32 returns a new 32-bit MurmurHash2.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL