xxhash – github.com/OneOfOne/xxhash Index | Files

package xxhash

import "github.com/OneOfOne/xxhash"

Index

Constants

const Backend = "GoUnsafe"

Backend returns the current version of xxhash being used.

Functions

func Checksum32

func Checksum32(in []byte) uint32

Checksum32 returns the checksum of the input data with the seed set to 0.

func Checksum32S

func Checksum32S(in []byte, seed uint32) (h uint32)

Checksum32S returns the checksum of the input bytes with the specific seed.

func Checksum64

func Checksum64(in []byte) uint64

Checksum64 an alias for Checksum64S(in, 0)

func Checksum64S

func Checksum64S(in []byte, seed uint64) uint64

Checksum64S returns the 64bit xxhash checksum for a single input

func ChecksumString32

func ChecksumString32(s string) uint32

ChecksumString32 returns the checksum of the input data, without creating a copy, with the seed set to 0.

func ChecksumString32S

func ChecksumString32S(s string, seed uint32) uint32

ChecksumString32S returns the checksum of the input data, without creating a copy, with the specific seed.

func ChecksumString64

func ChecksumString64(s string) uint64

ChecksumString64 returns the checksum of the input data, without creating a copy, with the seed set to 0.

func ChecksumString64S

func ChecksumString64S(s string, seed uint64) uint64

ChecksumString64S returns the checksum of the input data, without creating a copy, with the specific seed.

func NewHash32

func NewHash32() hash.Hash

func NewHash64

func NewHash64() hash.Hash

Types

type XXHash32

type XXHash32 struct {
	// contains filtered or unexported fields
}

func New32

func New32() *XXHash32

New32 creates a new hash.Hash32 computing the 32bit xxHash checksum starting with the seed set to 0.

func NewS32

func NewS32(seed uint32) (xx *XXHash32)

NewS32 creates a new hash.Hash32 computing the 32bit xxHash checksum starting with the specific seed.

func (*XXHash32) BlockSize

func (xx *XXHash32) BlockSize() int

BlockSize returns the hash's underlying block size. The Write method must be able to accept any amount of data, but it may operate more efficiently if all writes are a multiple of the block size.

func (*XXHash32) MarshalBinary

func (xx *XXHash32) MarshalBinary() ([]byte, error)

MarshalBinary implements the encoding.BinaryMarshaler interface.

func (*XXHash32) Reset

func (xx *XXHash32) Reset()

func (*XXHash32) Size

func (xx *XXHash32) Size() int

Size returns the number of bytes Sum will return.

func (*XXHash32) Sum

func (xx *XXHash32) Sum(in []byte) []byte

Sum appends the current hash to b and returns the resulting slice. It does not change the underlying hash state.

func (*XXHash32) Sum32

func (xx *XXHash32) Sum32() (h uint32)

func (*XXHash32) UnmarshalBinary

func (xx *XXHash32) UnmarshalBinary(b []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.

func (*XXHash32) Write

func (xx *XXHash32) Write(in []byte) (n int, err error)

func (*XXHash32) WriteString

func (xx *XXHash32) WriteString(s string) (int, error)

type XXHash64

type XXHash64 struct {
	// contains filtered or unexported fields
}

func New64

func New64() *XXHash64

New64 creates a new hash.Hash64 computing the 64bit xxHash checksum starting with the seed set to 0x0.

func NewS64

func NewS64(seed uint64) (xx *XXHash64)

NewS64 creates a new hash.Hash64 computing the 64bit xxHash checksum starting with the specific seed.

func (*XXHash64) BlockSize

func (xx *XXHash64) BlockSize() int

BlockSize returns the hash's underlying block size. The Write method must be able to accept any amount of data, but it may operate more efficiently if all writes are a multiple of the block size.

func (*XXHash64) MarshalBinary

func (xx *XXHash64) MarshalBinary() ([]byte, error)

MarshalBinary implements the encoding.BinaryMarshaler interface.

func (*XXHash64) Reset

func (xx *XXHash64) Reset()

func (*XXHash64) Size

func (xx *XXHash64) Size() int

Size returns the number of bytes Sum will return.

func (*XXHash64) Sum

func (xx *XXHash64) Sum(in []byte) []byte

Sum appends the current hash to b and returns the resulting slice. It does not change the underlying hash state.

func (*XXHash64) Sum64

func (xx *XXHash64) Sum64() (h uint64)

func (*XXHash64) UnmarshalBinary

func (xx *XXHash64) UnmarshalBinary(b []byte) error

UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.

func (*XXHash64) Write

func (xx *XXHash64) Write(in []byte) (n int, err error)

func (*XXHash64) WriteString

func (xx *XXHash64) WriteString(s string) (int, error)

Source Files

xxhash.go xxhash_go17.go xxhash_unsafe.go

Version
v1.2.8 (latest)
Published
May 24, 2020
Platform
js/wasm
Imports
5 packages
Last checked
now

Tools for package owners.