Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckErr ¶
CheckErr checks if an error is not nil and returns a formatted error message. If the error is nil, it returns nil.
Parameters:
- msg: A string message to prepend to the error message.
- err: The error to check.
Returns:
- An error with the formatted message if err is not nil, otherwise nil.
func GenerateRandomSalt ¶
GenerateRandomSalt generates a random salt of 32 bytes.
Returns:
- A byte slice containing the random salt.
- An error if the random salt generation fails.
func HashPassword ¶ added in v1.0.2
HashPassword hashes the input password using SHA-256. It returns the hashed password as a byte slice.
func ValidatePassword ¶ added in v1.0.2
ValidatePassword compares the input password with the saved hash. It returns true if the passwords match, false otherwise.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.