Documentation ¶
Overview ¶
Package wyhash implements https://github.com/wangyi-fudan/wyhash
Index ¶
- Constants
- func BytesToString(b []byte) string
- func Sum64(data []byte) uint64
- func Sum64String(data string) uint64
- func Sum64StringWithSeed(data string, seed uint64) uint64
- func Sum64WithSeed(data []byte, seed uint64) uint64
- type Digest
- func (d *Digest) BlockSize() int
- func (d *Digest) InitSeed() uint64
- func (d *Digest) Reset()
- func (d *Digest) Seed() uint64
- func (d *Digest) SetInitSeed(seed uint64)
- func (d *Digest) SetSeed(seed uint64)
- func (d *Digest) Size() int
- func (d *Digest) Sum(b []byte) []byte
- func (d *Digest) Sum64() uint64
- func (d *Digest) Write(input []byte) (int, error)
Constants ¶
View Source
const (
DefaultSeed = 0xa0761d6478bd642f // s0
)
Variables ¶
This section is empty.
Functions ¶
func BytesToString ¶
BytesToString converts a byte slice to a string.
This is a shallow copy, means that the returned string reuse the underlying array in byte slice, it's your responsibility to keep the input byte slice survive until you don't access the string anymore.
func Sum64String ¶
func Sum64StringWithSeed ¶
func Sum64WithSeed ¶
Types ¶
type Digest ¶
type Digest struct {
// contains filtered or unexported fields
}
func NewDefault ¶
func NewDefault() *Digest
func (*Digest) Reset ¶
func (d *Digest) Reset()
Reset the digest, and the seed will be reset to initseed. The initseed is the seed when digest has been created.
func (*Digest) SetInitSeed ¶
Click to show internal directories.
Click to hide internal directories.