Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( HashFunc = sha1.New // Hash function to use Iterations = 16384 // Number of iterations to use KeySize = 32 // Output size of key (32 is suitable for AES256) SaltSize = 16 // Size of salt. Recommend >8. )
Functions ¶
func MatchPassword ¶
func MatchPassword(password string, ph *PasswordHash) bool
MatchPassword compares the input password with the password hash. It returns true if they match.
Types ¶
type PasswordHash ¶
Type PasswordHash stores a hashed version of a password.
func HashPassword ¶
func HashPassword(password string) *PasswordHash
HashPassword generates a salt and returns a hashed version of the password.
func HashPasswordWithSalt ¶
func HashPasswordWithSalt(password string, salt []byte) (ph *PasswordHash)
HashPasswordWithSalt hashes the password with the specified salt.
Click to show internal directories.
Click to hide internal directories.