password

package
v0.4.7 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HashArgon2id

func HashArgon2id(password string) (string, error)

HashArgon2id returns a PHC-encoded string.

func IsBcryptHash

func IsBcryptHash(hash string) bool

IsBcryptHash detects common bcrypt PHC prefixes.

func Validate

func Validate(password string) error

Validate applies the current password policy. Minimal policy: length >= 8 characters.

func VerifyArgon2id

func VerifyArgon2id(encoded, password string) (bool, error)

VerifyArgon2id checks a password against a PHC-encoded hash.

func VerifyBcrypt

func VerifyBcrypt(hash, password string) (bool, error)

VerifyBcrypt compares a bcrypt hash with a plaintext password.

Types

type Params

type Params struct {
	Time    uint32 // iterations
	Memory  uint32 // KiB
	Threads uint8
	SaltLen uint32
	KeyLen  uint32
}

Params defines Argon2id parameters.

func DefaultParams

func DefaultParams() Params

Jump to

Keyboard shortcuts

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