Help us shape the future of Go! Take the 2026 Go Developer Survey

password

package
v1.21.2 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Package password hashes account passwords with argon2id and checks sign-in attempts against the stored hash. It also checks the older formats, PPanel's own PBKDF2 and the md5, sha256 and bcrypt hashes of accounts imported from other panels, so those users can still sign in and have their hash upgraded to argon2id.

Index

Constants

View Source
const (
	PasswordAlgoArgon2id = "argon2id"
)

Variables

This section is empty.

Functions

func EncodePassWord

func EncodePassWord(str string) string

func IsLegacyHash added in v1.21.0

func IsLegacyHash(hash string) bool

IsLegacyHash reports whether a stored hash is in one of the older formats (PPanel's PBKDF2 or an imported md5, sha256 or bcrypt hash) rather than argon2id. Such a hash is still accepted for its owner's next sign-in, which rehashes it; until then it stays weaker than the current format.

func MultiPasswordVerify

func MultiPasswordVerify(algo, salt, password, hash string) bool

func PasswordAlgoForHash

func PasswordAlgoForHash(hash string) string

func PasswordNeedsRehash

func PasswordNeedsRehash(algo, hash string) bool

func UserColumns added in v1.21.0

func UserColumns(plain string) map[string]any

UserColumns returns the user-row columns that store plain as a fresh argon2id hash, for column-scoped updates.

func VerifyPassWord

func VerifyPassWord(passwd, EncodePasswd string) bool

Types

This section is empty.

Jump to

Keyboard shortcuts

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