hashing

package
v0.6.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2020 License: Apache-2.0 Imports: 9 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.

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, data []byte) []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