Documentation ¶
Overview ¶
Package fnv implements FNV-1 and FNV-1a, non-cryptographic hash functions with non-allocating convenience methods for hashing of common types. Compatible with standard library hash/fnv.
Index ¶
- func String64(str string) uint64
- func String64a(str string) uint64
- func Sum64(buf []byte) uint64
- func Sum64a(buf []byte) uint64
- type Fnv64
- func (s *Fnv64) BlockSize() int
- func (s *Fnv64) Reset()
- func (s *Fnv64) Size() int
- func (s *Fnv64) Sum(buf []byte) []byte
- func (s *Fnv64) Sum64() uint64
- func (s *Fnv64) Write(data []byte) (int, error)
- func (s *Fnv64) WriteByte(b byte) error
- func (s *Fnv64) WriteString(str string) (int, error)
- func (s *Fnv64) WriteUint64(n uint64)
- type Fnv64a
- func (s *Fnv64a) BlockSize() int
- func (s *Fnv64a) Reset()
- func (s *Fnv64a) Size() int
- func (s *Fnv64a) Sum(buf []byte) []byte
- func (s *Fnv64a) Sum64() uint64
- func (s *Fnv64a) Write(data []byte) (int, error)
- func (s *Fnv64a) WriteByte(b byte) error
- func (s *Fnv64a) WriteString(str string) (int, error)
- func (s *Fnv64a) WriteUint64(n uint64)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Fnv64 ¶
type Fnv64 uint64
64-bit FNV-1 hash.
func (*Fnv64) Sum ¶
Sum appends the current hash to buf in big-endian byte order and returns the resulting slice.
func (*Fnv64) WriteByte ¶
Write adds the single byte b to the running hash. It never returns an error.
func (*Fnv64) WriteString ¶
WriteString adds the bytes of string str to the running hash and returns the number of bytes written. It never returns an error.
func (*Fnv64) WriteUint64 ¶
WriteUint64 adds the 8 bytes of n to the running hash in big-endian byte order.
type Fnv64a ¶
type Fnv64a uint64
64-bit FNV-1a hash.
func (*Fnv64a) Sum ¶
Sum appends the current hash to buf in big-endian byte order and returns the resulting slice.
func (*Fnv64a) WriteByte ¶
Write adds the single byte b to the running hash. It never returns an error.
func (*Fnv64a) WriteString ¶
WriteString adds the bytes of string str to the running hash and returns the number of bytes written. It never returns an error.
func (*Fnv64a) WriteUint64 ¶
WriteUint64 adds the 8 bytes of n to the running hash in big-endian byte order.