hashing

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(h Hash, f func() Hasher)

Types

type Hash

type Hash uint
const (
	MD5 Hash = 1 + iota
)

func (Hash) Available

func (h Hash) Available() bool

func (Hash) New

func (h Hash) New() Hasher

type Hasher added in v1.1.0

type Hasher interface {
	// Make a hash value from the given value.
	Make(value string) (string, error)

	// MustMake a hash value from the given value.
	// If an error occurs, it will panic.
	MustMake(value string) string

	// Check the given value matches the given hashed value.
	// If you Make() is error, it will return false.
	Check(value, hashedValue string) bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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