password

package
v0.9.0-rc.53 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: AGPL-3.0 Imports: 17 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	Algorithm         = "pbkdf2_sha256"
	DefaultIterations = 1000000
)
View Source
const MinLength = 8

Variables

View Source
var (
	ErrMalformed   = errors.New("malformed password hash")
	ErrUnsupported = errors.New("unsupported password hash algorithm")
)
View Source
var (
	ErrTooShort   = errors.New("password: shorter than the minimum")
	ErrTooCommon  = errors.New("password: on the common list")
	ErrAllNumeric = errors.New("password: entirely numeric")
	ErrTooSimilar = errors.New("password: too close to the account's own details")
)

Functions

func Hash

func Hash(plain string) (string, error)

func IsUsable

func IsUsable(encoded string) bool

func NeedsRehash

func NeedsRehash(encoded string) bool

func Validate

func Validate(plain string, about Attributes) error

func Verify

func Verify(plain, encoded string) (bool, error)

Types

type Attributes

type Attributes struct {
	Username    string
	DisplayName string
	FirstName   string
	LastName    string
	Email       string
}

Jump to

Keyboard shortcuts

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