Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateSalt ¶
Usage
salt, err := generateSalt()
if err != nil { log.Fatal("Failed to generate salt:", err) }
func HashPassword ¶
Usage NOTE: Store both the hash and salt in the database, it is needed to verify the password
hash, salt := hashPassword(password, salt)
func VerifyPassword ¶
Usage
isValid, err := verifyPassword(hashedPassword, hashedSalt, password)
if err != nil { log.Fatal("Failed to verify password:", err) }
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.