hash

package
v1.18.4 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Hash64 added in v0.17.3

func Hash64(buf []byte) uint64

Hash64 computes the FNV-1a hash of buf.

Types

type HashMap

type HashMap map[uint64][]byte

func NewHashMap

func NewHashMap() HashMap

func (*HashMap) Add

func (m *HashMap) Add(buf []byte) int

func (HashMap) Contains

func (m HashMap) Contains(buf []byte) bool

func (*HashMap) Remove

func (m *HashMap) Remove(buf []byte) int

type InlineFNV64a

type InlineFNV64a uint64

InlineFNV64a is an alloc-free port of the standard library's fnv64a. See https://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function

func NewInlineFNV64a

func NewInlineFNV64a() InlineFNV64a

NewInlineFNV64a returns a new instance of InlineFNV64a.

func (*InlineFNV64a) Reset added in v0.17.3

func (s *InlineFNV64a) Reset()

func (*InlineFNV64a) Sum

func (s *InlineFNV64a) Sum() []byte

func (*InlineFNV64a) Sum64

func (s *InlineFNV64a) Sum64() uint64

Sum64 returns the uint64 of the current resulting hash.

func (*InlineFNV64a) Write

func (s *InlineFNV64a) Write(data []byte) (int, error)

Write adds data to the running hash.

func (*InlineFNV64a) WriteString

func (s *InlineFNV64a) WriteString(data string) (int, error)

Write adds data to the running hash.

Jump to

Keyboard shortcuts

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