Documentation ¶
Index ¶
Constants ¶
View Source
const ( // HashSHA256 is the has key used to tell a hasher // to use the SHA256 hashing algorithm. HashSHA256 = 1 // HashSHA512 is the has key used to tell a hasher // to use the SHA512 hashing algorithm. HashSHA512 = 2 // DefaultIterationCount is the default number of times a // password will be hashed. DefaultIterationCount = 1000 // DefaultSaltSize is the default size of password salts. DefaultSaltSize = 128 // DefaultKeySize is the default size of password sub-keys. DefaultKeySize = 256 // DefaultHashKey is the default hash key. DefaultHashKey = HashSHA256 )
Variables ¶
View Source
var ( ErrInvalidIterationCount = errors.New("iteration count must be at least 1") ErrInvalidSaltSize = errors.New("salt size must be positive and divisible by 8") ErrInvalidKeySize = errors.New("key size must be positive and divisinle by 8") )
Common errors.
Functions ¶
Types ¶
type Hasher ¶
Hasher is a high-level interface used to hash and verify passwords using the pbkdf2 key derivation algorithm. Using an adaptive format, passwords can be hashed using different hash algorithms and key sizes.
Click to show internal directories.
Click to hide internal directories.