xxHash64

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2019 License: BSD-3-Clause Imports: 1 Imported by: 197

Documentation

Overview

Package xxHash64 implements the very fast xxHash hashing algorithm (64 bits version). (https://github.com/Cyan4973/xxHash/)

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Checksum

func Checksum(input []byte, seed uint64) uint64

Checksum returns the 64bits Hash value.

Example
package main

import (
	"bytes"
	"fmt"
	"github.com/pierrec/xxHash/xxHash64"
)

func main() {
	buf := bytes.NewBufferString("this is a test")
	fmt.Printf("%x\n", xxHash64.Checksum(buf.Bytes(), 0xCAFE))
}
Output:

4228c3215949e862

func New

func New(seed uint64) hash.Hash64

New returns a new Hash64 instance.

Example
package main

import (
	"bytes"
	"fmt"
	"github.com/pierrec/xxHash/xxHash64"
)

func main() {
	buf := bytes.NewBufferString("this is a test")
	x := xxHash64.New(0xCAFE)
	x.Write(buf.Bytes())
	fmt.Printf("%x\n", x.Sum64())
}
Output:

4228c3215949e862

Types

This section is empty.

Jump to

Keyboard shortcuts

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