gvisorgvisor.dev/gvisor/pkg/tcpip/hash/jenkins Index | Files

package jenkins

import "gvisor.dev/gvisor/pkg/tcpip/hash/jenkins"

Package jenkins implements Jenkins's one_at_a_time, non-cryptographic hash functions created by by Bob Jenkins.

See https://en.wikipedia.org/wiki/Jenkins_hash_function#cite_note-dobbsx-1

Index

Functions

func New32

func New32() hash.Hash32

New32 returns a new 32-bit Jenkins's one_at_a_time hash.Hash.

Its Sum method will lay the value out in big-endian byte order.

Types

type Sum32

type Sum32 uint32

Sum32 represents Jenkins's one_at_a_time hash.

Use the Sum32 type directly (as opposed to New32 below) to avoid allocations.

func (*Sum32) BlockSize

func (s *Sum32) BlockSize() int

BlockSize returns the hash's underlying block size.

func (*Sum32) Reset

func (s *Sum32) Reset()

Reset resets the hash to its initial state.

func (*Sum32) Size

func (s *Sum32) Size() int

Size returns the number of bytes Sum will return.

func (*Sum32) Sum

func (s *Sum32) Sum(in []byte) []byte

Sum appends the current hash to in and returns the resulting slice.

It does not change the underlying hash state.

func (*Sum32) Sum32

func (s *Sum32) Sum32() uint32

Sum32 returns the hash value

func (*Sum32) Write

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

Write adds more data to the running hash.

It never returns an error.

Source Files

jenkins.go

Version
v0.0.0-20250515200445-d30c58e5b8a4 (latest)
Published
May 15, 2025
Platform
linux/amd64
Imports
1 packages
Last checked
10 hours ago

Tools for package owners.