hasher

package
v0.0.0-...-3afac47 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Argon2Hasher

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

func NewArgon2Hasher

func NewArgon2Hasher(salt []byte, time, memory uint32, threads uint8, keyLen uint32) *Argon2Hasher

func (*Argon2Hasher) Check

func (b *Argon2Hasher) Check(value string, hashedValue string) bool

Check the given plain value against a hash.

func (*Argon2Hasher) Make

func (b *Argon2Hasher) Make(value string) string

Hash the given value.

type BcyptHasher

type BcyptHasher struct{}

func NewBcyptHasher

func NewBcyptHasher() *BcyptHasher

func (*BcyptHasher) Check

func (b *BcyptHasher) Check(value string, hashedValue string) bool

Check the given plain value against a hash.

func (*BcyptHasher) Make

func (b *BcyptHasher) Make(value string) string

Hash the given value.

type Hasher

type Hasher interface {
	// Hash the given value.
	Make(value string) string

	// Check the given plain value against a hash.
	Check(value string, hashedValue string) bool
}

Jump to

Keyboard shortcuts

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