Documentation ¶
Overview ¶
Package hash implements key generation and password hashing operations.
Index ¶
Constants ¶
View Source
const DigestSize = 64
Variables ¶
This section is empty.
Functions ¶
func Password ¶
Password hashes a given password with a given salt. It returns an hash of the given size.
func PasswordCompare ¶
PasswordCompare allows comparison between a given password and a given hashed password.
Returns true if after hashing the given password with the given salt the output hash of the given size is equal to the given hashed password. Else returns false.
Types ¶
type MismatchErr ¶
type MismatchErr string
const ErrMismatchedHashandPassword MismatchErr = "the hashed password does not match the hash of the given password"
ErrMismatchedHashAndPassword is returned when a password (hashed) and given hash do not match.
func (MismatchErr) Error ¶
func (e MismatchErr) Error() string
Click to show internal directories.
Click to hide internal directories.