passwords

package
v0.0.0-...-6b2a69b Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2020 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hasher

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

Hasher can hash and verify hashes of incoming strings. Create these with the NewHasher() function

func NewHasher

func NewHasher(params config.Hash) *Hasher

NewHasher makes a Hasher which runs Argon2 with the given params.

func (*Hasher) Hash

func (h *Hasher) Hash(value string) (string, error)

Hash hashes a string and returns the hashed value.

func (*Hasher) Matches

func (h *Hasher) Matches(value string, hash string) (bool, error)

Matches returns true if the value matches the hash, and false otherwise. An error will be thrown if the hash isn't formatted properly. This shouldn't happen with hashes generated by the Hash() function

Jump to

Keyboard shortcuts

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