hashing

package
v0.11.3 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2022 License: Apache-2.0 Imports: 11 Imported by: 2

Documentation

Overview

Package hashing encapsulates all keyed hashing algorithms.

Index

Constants

View Source
const DefaultAlgorithm = "BLAKE2B-256-128"

DefaultAlgorithm is the name of the default hash algorithm.

View Source
const MaxHashSize = 32

MaxHashSize is the maximum hash size supported in the system.

Variables

This section is empty.

Functions

func Register

func Register(name string, newHashFunc HashFuncFactory)

Register registers a hash function with a given name.

func SupportedAlgorithms

func SupportedAlgorithms() []string

SupportedAlgorithms returns the names of the supported hashing schemes.

Types

type HashFunc

type HashFunc func(output []byte, data gather.Bytes) []byte

HashFunc computes hash of content of data using a cryptographic hash function, possibly with HMAC and/or truncation.

func CreateHashFunc

func CreateHashFunc(p Parameters) (HashFunc, error)

CreateHashFunc creates hash function from a given parameters.

type HashFuncFactory

type HashFuncFactory func(p Parameters) (HashFunc, error)

HashFuncFactory returns a hash function for given formatting options.

type Parameters

type Parameters interface {
	GetHashFunction() string
	GetHmacSecret() []byte
}

Parameters encapsulates all hashing-relevant parameters.

Jump to

Keyboard shortcuts

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