buz

package
v0.0.0-...-5fdc4cc Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package buz implements hashing by cyclic polynomial (buzhash).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hash32

type Hash32 struct {
	// contains filtered or unexported fields
}

A Hash32 is a rolling 32-bit buzhash.

func New32

func New32(windowSize int) *Hash32

func (*Hash32) Reset

func (h *Hash32) Reset()

func (*Hash32) Roll

func (h *Hash32) Roll(in, out byte)

func (*Hash32) Sum32

func (h *Hash32) Sum32() uint32

func (*Hash32) WindowSize

func (h *Hash32) WindowSize() int

func (*Hash32) WriteInitial

func (h *Hash32) WriteInitial(data []byte) int

type Tabular32

type Tabular32 struct {
	// contains filtered or unexported fields
}

A Tabular32 computes a buzhash on top of a tabular hash.

In this hash, each incoming byte is first mapped to a 32-bit value by a lookup table (tabular hash), then the buzhash is computed from those 32-bit values.

func NewTabular32

func NewTabular32(table *[256]uint32, windowSize int) *Tabular32

NewTabular32 constructs a Tabular32. It copies the contents of the table argument.

func (*Tabular32) Reset

func (h *Tabular32) Reset()

func (*Tabular32) Roll

func (h *Tabular32) Roll(in, out byte)

func (*Tabular32) Sum32

func (h *Tabular32) Sum32() uint32

func (*Tabular32) WindowSize

func (h *Tabular32) WindowSize() int

func (*Tabular32) WriteInitial

func (h *Tabular32) WriteInitial(data []byte) int

Jump to

Keyboard shortcuts

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