package
0.0.0-20180330192724-a09253046f73
Repository: https://github.com/metaleap/go-util.git
Documentation: pkg.go.dev

# README

uhash

Go programming helpers for common hashing needs.

Also implements a selection of the hashing algorithms described at: http://eternallyconfuzzled.com/tuts/algorithms/jsw_tut_hashing.aspx

Usage

func Fnv1

func Fnv1(vals []int) (h int)

Fowler/Noll/Vo '1'

func Fnv1a

func Fnv1a(vals []int) (h int)

Fowler/Noll/Vo '1a'

func ModifiedBernstein

func ModifiedBernstein(vals []int) (h int)

A minor update to Bernstein's hash replaces addition with XOR for the combining step.

func OneAtATime

func OneAtATime(vals []int) (h int)

Bob Jenkins

func RotatingAdd

func RotatingAdd(vals []int) (h int)

The rotating hash with SUM

func RotatingXor

func RotatingXor(vals []int) (h int)

The rotating hash with XOR

func WriteAndSum

func WriteAndSum(h hash.Hash, data, b []byte) (sum []byte, err error)

Convenience short-hand for h.Write(data), then h.Sum(b).