示例#1
0
文件: scrypt.go 项目: aktuba/passlib
func (c *scryptSHA256Crypter) hash(password, stub string) (oldHashRaw []byte, newHash string, salt []byte, N, r, p int, err error) {
	salt, oldHashRaw, N, r, p, err = raw.Parse(stub)
	if err != nil {
		return
	}

	return oldHashRaw, raw.ScryptSHA256(password, salt, N, r, p), salt, N, r, p, nil
}
示例#2
0
文件: scrypt.go 项目: aktuba/passlib
func (c *scryptSHA256Crypter) NeedsUpdate(stub string) bool {
	salt, _, N, r, p, err := raw.Parse(stub)
	if err != nil {
		return false // ...
	}

	return c.needsUpdate(salt, N, r, p)
}