Documentation ¶
Index ¶
- Constants
- func Checksum32(in []byte) uint32
- func Checksum32S(in []byte, seed uint32) (h uint32)
- func Checksum64(in []byte) uint64
- func Checksum64S(in []byte, seed uint64) uint64
- func ChecksumString32(s string) uint32
- func ChecksumString32S(s string, seed uint32) uint32
- func ChecksumString64(s string) uint64
- func ChecksumString64S(s string, seed uint64) uint64
- func NewHash32() hash.Hash
- func NewHash64() hash.Hash
- type XXHash32
- func (xx *XXHash32) BlockSize() int
- func (xx *XXHash32) MarshalBinary() ([]byte, error)
- func (xx *XXHash32) Reset()
- func (xx *XXHash32) Size() int
- func (xx *XXHash32) Sum(in []byte) []byte
- func (xx *XXHash32) Sum32() (h uint32)
- func (xx *XXHash32) UnmarshalBinary(b []byte) error
- func (xx *XXHash32) Write(in []byte) (n int, err error)
- func (xx *XXHash32) WriteString(s string) (int, error)
- type XXHash64
- func (xx *XXHash64) BlockSize() int
- func (xx *XXHash64) MarshalBinary() ([]byte, error)
- func (xx *XXHash64) Reset()
- func (xx *XXHash64) Size() int
- func (xx *XXHash64) Sum(in []byte) []byte
- func (xx *XXHash64) Sum64() (h uint64)
- func (xx *XXHash64) UnmarshalBinary(b []byte) error
- func (xx *XXHash64) Write(in []byte) (n int, err error)
- func (xx *XXHash64) WriteString(s string) (int, error)
Constants ¶
const Backend = "GoUnsafe"
Backend returns the current version of xxhash being used.
Variables ¶
This section is empty.
Functions ¶
func Checksum32 ¶
Checksum32 returns the checksum of the input data with the seed set to 0.
func Checksum32S ¶
Checksum32S returns the checksum of the input bytes with the specific seed.
func Checksum64S ¶
Checksum64S returns the 64bit xxhash checksum for a single input
func ChecksumString32 ¶
ChecksumString32 returns the checksum of the input data, without creating a copy, with the seed set to 0.
func ChecksumString32S ¶
ChecksumString32S returns the checksum of the input data, without creating a copy, with the specific seed.
func ChecksumString64 ¶
ChecksumString64 returns the checksum of the input data, without creating a copy, with the seed set to 0.
func ChecksumString64S ¶
ChecksumString64S returns the checksum of the input data, without creating a copy, with the specific seed.
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 ¶
NewS32 creates a new hash.Hash32 computing the 32bit xxHash checksum starting with the specific seed.
func (*XXHash32) BlockSize ¶
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 ¶ added in v1.2.8
MarshalBinary implements the encoding.BinaryMarshaler interface.
func (*XXHash32) Sum ¶
Sum appends the current hash to b and returns the resulting slice. It does not change the underlying hash state.
func (*XXHash32) UnmarshalBinary ¶ added in v1.2.8
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.
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 ¶
NewS64 creates a new hash.Hash64 computing the 64bit xxHash checksum starting with the specific seed.
func (*XXHash64) BlockSize ¶
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 ¶ added in v1.2.8
MarshalBinary implements the encoding.BinaryMarshaler interface.
func (*XXHash64) Sum ¶
Sum appends the current hash to b and returns the resulting slice. It does not change the underlying hash state.
func (*XXHash64) UnmarshalBinary ¶ added in v1.2.8
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.