argon2

package
v0.0.0-...-c39e8e5 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2022 License: AGPL-3.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Password

type Password struct {
	Key     []byte // Hashed key.
	Salt    []byte
	Time    uint32
	Memory  uint32
	Threads uint8
	KeyLen  uint32
}

Password saves the password hashed with Argon2 algorithm.

func NewPassword

func NewPassword(password []byte, rand io.Reader) (*Password, error)

NewPassword creates a new password encrypted by argon2 algorithm.

func (*Password) Check

func (p *Password) Check(password []byte) bool

Check checks if the password matches.

func (*Password) CheckString

func (p *Password) CheckString(password string) bool

CheckString checks if the password matches the given string.

Jump to

Keyboard shortcuts

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