utils

package
v0.0.0-...-9e9cf27 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPasswordHash

func CheckPasswordHash(password, hash string) bool

func HashPassword

func HashPassword(password string) (string, error)

For backward compatibility, keep the package-level functions

Types

type PasswordHasher

type PasswordHasher struct{}

PasswordHasher handles password hashing operations

func NewPasswordHasher

func NewPasswordHasher() *PasswordHasher

NewPasswordHasher creates a new PasswordHasher

func (*PasswordHasher) CheckPasswordHash

func (p *PasswordHasher) CheckPasswordHash(password, hash string) bool

CheckPasswordHash compares a bcrypt hashed password with its possible plaintext equivalent

func (*PasswordHasher) HashPassword

func (p *PasswordHasher) HashPassword(password string) (string, error)

HashPassword creates a bcrypt hash of the password

Jump to

Keyboard shortcuts

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