uhash

package
v0.0.0-...-76c535a Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2021 License: MIT Imports: 1 Imported by: 0

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

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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)`.

Types

This section is empty.

Jump to

Keyboard shortcuts

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