jenkins

package
v0.0.0-...-7321e42 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0, MIT Imports: 1 Imported by: 8

Documentation

Overview

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

Constants

This section is empty.

Variables

This section is empty.

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.

Jump to

Keyboard shortcuts

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