crypto

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2021 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrPasswordMismatch = argon2go.ErrMismatch

ErrPasswordMismatch is returned when a password does not match the hash.

Functions

func Hash

func Hash(creds *models.MailboxCredentialEntity, pass []byte) (err error)

Hash applies the argon2id hashing algorithm to a password and stores the hash in the credentials. The options used for hashing are determined using viper.

func Verify

func Verify(creds *models.MailboxCredentialEntity, pass []byte) error

Verify checks if a password matches the credentials hash. If the password does not match ErrPasswordMismatch is returned. There may occur other, technical errors.

Types

type IDGenerator

type IDGenerator interface {
	// GenerateID generates a new id.
	GenerateID() (string, error)
}

IDGenerator is a service to generate unique string IDs.

func NewIDGenerator

func NewIDGenerator() IDGenerator

NewIDGenerator creates a new id generator.

Jump to

Keyboard shortcuts

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