blob: 576d0521d123343ce86191d439287e1cadb2536a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
package pwhash
import (
"crypto/pbkdf2"
"crypto/sha512"
)
const SaltSize = 8
const defaultIter = 12059332 // from tools/finditer
func HashIter(password string, salt []byte, iter int) ([]byte, error) {
return pbkdf2.Key(sha512.New, password, salt, iter, 32)
}
func Hash(password string, salt []byte) ([]byte, error) {
return HashIter(password, salt, defaultIter)
}
|