Skip to content

vcaesar/murmur

Repository files navigation

murmur

Build Status CircleCI Status codecov Build Status Go Report Card GoDoc Release Join the chat at https://gitter.im/vcaesar/ego

Go Murmur3 hash implementation

Installing

go get -u github.com/vcaesar/murmur

Use

package main

import (
	"log"

	"github.com/vcaesar/murmur"
)

func main() {
	var str = "github.com/vcaesar/murmur"

	sum32 := murmur.Sum32(str)
	log.Println("hash32: ", sum32)

	sum32 = murmur.Sum32(str, 0)
	log.Println("hash32: ", hash32)

	hash32 := murmur.Murmur3([]byte(str))
	log.Println("hash32...", hash32)

	hash32 = murmur.Murmur3([]byte(str), 1)
	log.Println("hash32...", hash32)
}

Based on MurmurHash, thanks for murmur3.