meow

package module
v0.0.0-...-3501c7c Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2020 License: Zlib Imports: 4 Imported by: 21

README

meow

Golang implementation of the Meow hash, an extremely fast non-cryptographic hash.

go.dev Reference

Warning

The official implemention is in flux, therefore this one is too. The Travis CI build (config) tests against master branch of the reference implementation, therefore build status should be a good indicator of compatibility. This package is unlikely to be updated until the reference implementation stabilizes.

License

Zlib license following the official implemention.

Documentation

Index

Examples

Constants

View Source
const (
	Version     = 2
	VersionName = "0.2/Ragdoll"
)

Meow hash version implemented by this package.

View Source
const BlockSize = 256

BlockSize is the underlying block size of Meow hash in bytes.

View Source
const Size = 16

Size of a Meow checksum in bytes.

Variables

This section is empty.

Functions

func Checksum

func Checksum(seed uint64, data []byte) [Size]byte

Checksum returns the Meow checksum of data.

Example
package main

import (
	"fmt"

	"github.com/mmcloughlin/meow"
)

func main() {
	checksum := meow.Checksum(0, []byte("Hello, World!"))
	fmt.Printf("%x\n", checksum)
}
Output:

a8cfb4aad7eada8ef007aafe27135386

func Checksum32

func Checksum32(seed uint64, data []byte) uint32

Checksum32 returns the 32-bit checksum of data.

func Checksum64

func Checksum64(seed uint64, data []byte) uint64

Checksum64 returns the 64-bit checksum of data.

func New

func New(seed uint64) hash.Hash

New returns a 128-bit Meow hash.

Example
package main

import (
	"fmt"
	"io"

	"github.com/mmcloughlin/meow"
)

func main() {
	h := meow.New(0)
	io.WriteString(h, "Hello, ")
	io.WriteString(h, "World!")
	fmt.Printf("%x\n", h.Sum(nil))
}
Output:

a8cfb4aad7eada8ef007aafe27135386

func New32

func New32(seed uint64) hash.Hash32

New32 returns the 32-bit version of Meow hash.

func New64

func New64(seed uint64) hash.Hash64

New64 returns the 64-bit version of Meow hash.

Types

This section is empty.

Jump to

Keyboard shortcuts

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