murmur

package module
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

README

murmur

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"

	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 murmur.

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.

Types

This section is empty.

Jump to

Keyboard shortcuts

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