|
|
@ -97,6 +97,7 @@ func GetRandomString(n int, alphabets ...byte) string { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// http://code.google.com/p/go/source/browse/pbkdf2/pbkdf2.go?repo=crypto
|
|
|
|
// http://code.google.com/p/go/source/browse/pbkdf2/pbkdf2.go?repo=crypto
|
|
|
|
|
|
|
|
// FIXME: use https://godoc.org/golang.org/x/crypto/pbkdf2?
|
|
|
|
func PBKDF2(password, salt []byte, iter, keyLen int, h func() hash.Hash) []byte { |
|
|
|
func PBKDF2(password, salt []byte, iter, keyLen int, h func() hash.Hash) []byte { |
|
|
|
prf := hmac.New(h, password) |
|
|
|
prf := hmac.New(h, password) |
|
|
|
hashLen := prf.Size() |
|
|
|
hashLen := prf.Size() |
|
|
|