password

package
v0.0.0-...-122f59b Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const MaxLength = 8192

MaxLength is the maximum length of input password Password exceeding this length would be truncated internally before hashing.

Variables

View Source
var ErrNewPasswordTypo = apierrors.Invalid.WithReason("NewPasswordTypo").New("new password typo")
View Source
var ErrTooLong = errors.New("password is too long")

Functions

func CheckHash

func CheckHash(hash []byte) error

func Compare

func Compare(password, hash []byte) error

func ConfirmPassword

func ConfirmPassword(newPassword, confirmPassword string) error

ConfirmPassword checks if the user has made a typo mistake when creating their new password. Both input are given by the same person, constant time comparison is not needed here.

func Hash

func Hash(password []byte) ([]byte, error)

func TryMigrate

func TryMigrate(password []byte, hash *[]byte) (migrated bool, err error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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