hash

package
v0.0.0-...-7ffd827 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HMAC

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

HMAC wraps a hash.Hash function so we can use it without knowledge of what kind of hash it contains. In this context it is implied it will be a HMAC.

func NewHMAC

func NewHMAC(key string) *HMAC

NewHMAC creates a new object embedded with a HMAC hash. It wraps the stdlib hmac.New() but removes the users obligation to provide a func() that returns a hash.Hash as this handled by the constructor.

func (*HMAC) Hash

func (h *HMAC) Hash(input string) string

Hash is a helper function that will write the input to the hash and return the result as a string.

Jump to

Keyboard shortcuts

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