bcrypt

package
v2.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 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

CheckPasswordHash compares a bcrypt hashed password with its possible plain text equivalent. Returns true if the password matches the hash, false otherwise.

Example:

match := CheckPasswordHash("mySecret123", storedHash)

func HashPassword

func HashPassword(password string) (string, error)

HashPassword hashes the given plain text password using the bcrypt algorithm. It returns the hashed password as a string and any error encountered during hashing.

Example:

hash, err := HashPassword("mySecret123")
if err != nil { ... }

Types

This section is empty.

Jump to

Keyboard shortcuts

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