hash

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2025 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidHash         = errors.New("the encoded hash is not in the correct format")
	ErrIncompatibleVersion = errors.New("incompatible argon2 version")
)

Functions

func Create

func Create(password string) (string, error)

Create hashes a password using Argon2id. Returns a standard encoded string: $argon2id$v=19$m=65536,t=1,p=4$<salt>$<hash>

func DeriveKey

func DeriveKey(password string, salt []byte) ([]byte, error)

DeriveKey derives a 32-byte encryption key from a password and a salt.

func Verify

func Verify(password, encodedHash string) (bool, error)

Verify checks if a password matches the encoded hash.

Types

This section is empty.

Jump to

Keyboard shortcuts

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