package pwhash import ( "crypto/pbkdf2" "crypto/sha512" ) const SaltSize = 8 const defaultIter = 12175430 // 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) }