murmur

package module
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2021 License: Apache-2.0 Imports: 2 Imported by: 5

README

murmur

Build Status CircleCI Status codecov Build Status Go Report Card GoDoc Release

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.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Murmur3

func Murmur3(key []byte, seed ...uint32) uint32

Murmur3 returns a hash from the provided key using the specified seed.

func Sum32

func Sum32(key string, seed ...uint32) (hash uint32)

Sum32 returns a hash from the provided key useing the seed.

Types

This section is empty.

Jump to

Keyboard shortcuts

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