farm

package module
v0.0.0-...-a6ae236 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2020 License: MIT Imports: 2 Imported by: 1,891

README

go-farm

Google's FarmHash hash functions implemented in Go

Master Branch Master Build Status Master Coverage Status Go Report Card GoDoc

Description

FarmHash, a family of hash functions.

This is a (mechanical) translation of the non-SSE4/non-AESNI hash functions from Google's FarmHash (https://github.com/google/farmhash).

FarmHash provides hash functions for strings and other data. The functions mix the input bits thoroughly but are not suitable for cryptography.

All members of the FarmHash family were designed with heavy reliance on previous work by Jyrki Alakuijala, Austin Appleby, Bob Jenkins, and others.

For more information please consult https://github.com/google/farmhash

Getting started

This application is written in Go language, please refer to the guides in https://golang.org for getting started.

This project include a Makefile that allows you to test and build the project with simple commands. To see all available options:

make help

Running all tests

Before committing the code, please check if it passes all tests using

make qa

License

As this is a highly derivative work, I have placed it under the same license as the original implementation. See the LICENSE file for details.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fingerprint128

func Fingerprint128(s []byte) (lo, hi uint64)

Fingerprint128 is a 128-bit fingerprint function for byte-slices

func Fingerprint32

func Fingerprint32(s []byte) uint32

func Fingerprint64

func Fingerprint64(s []byte) uint64

func Hash128

func Hash128(s []byte) (lo, hi uint64)

Hash128 is a 128-bit hash function for byte-slices

func Hash128WithSeed

func Hash128WithSeed(s []byte, seed0, seed1 uint64) (lo, hi uint64)

Hash128WithSeed is a 128-bit hash function for byte-slices and a 128-bit seed

func Hash32

func Hash32(s []byte) uint32

Hash32 hashes a byte slice and returns a uint32 hash value

func Hash32WithSeed

func Hash32WithSeed(s []byte, seed uint32) uint32

Hash32WithSeed hashes a byte slice and a uint32 seed and returns a uint32 hash value

func Hash64

func Hash64(s []byte) uint64

func Hash64WithSeed

func Hash64WithSeed(s []byte, seed uint64) uint64

Hash64WithSeed hashes a byte slice and a uint64 seed and returns a uint64 hash value

func Hash64WithSeeds

func Hash64WithSeeds(s []byte, seed0, seed1 uint64) uint64

Hash64WithSeeds hashes a byte slice and two uint64 seeds and returns a uint64 hash value

Types

This section is empty.

Jump to

Keyboard shortcuts

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