hasher

package module
v3.3.3 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Argon2

type Argon2 struct {
	Config argon2.Config
}

Argon2 implements fosite.Hasher.

func New

func New(config *argon2.Config) *Argon2

New instantiates a new Argon 2 Hasher. Implements fosite.Hasher.

func (*Argon2) Compare

func (a *Argon2) Compare(ctx context.Context, hash, data []byte) error

Compare compares data with an Argon2 hash and returns an error if the two do not match.

func (*Argon2) Hash

func (a *Argon2) Hash(ctx context.Context, data []byte) ([]byte, error)

Hash creates a Argon2 hash from data or returns an error. The salt is automatically generated based on the length of the Salt as specified by Config.SaltLength

Jump to

Keyboard shortcuts

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