code

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Generator

type Generator interface {

	// Generate generates a code of arbitrary size.
	Generate(input []byte) []byte

	// Generate16 generates a 16-bit code for a given input value.
	Generate16(input []byte) uint16

	// Generate32 generates a 32-bit code for a given input value.
	Generate32(input []byte) uint32

	// Generate64 generates a 64-bit code for a given input value.
	Generate64(input []byte) uint64
}

Generator encapsulates a hash function which results in a 32 or 64-bit code.

func SHA1

func SHA1() Generator

SHA1 returns a generator which relies on sha1.Sum in order to generate a code for a given input value.

func SHA224

func SHA224() Generator

SHA224 returns a generator which relies on sha256.Sum224 in order to generate a code for a given input value.

func SHA256

func SHA256() Generator

SHA256 returns a generator which relies on sha256.Sum256 in order to generate a code for a given input value.

Jump to

Keyboard shortcuts

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