//
pkg.gl
Category
github.com/ccnj/go-utils
passhash
package
0.0.5
Repository:
https://github.com/ccnj/go-utils.git
Documentation:
pkg.go.dev
Overview
Versions
1
Dependencies
4
Dependents
1
Files
49 SLOC
#
Functions
EasyHash
传入原始密码和盐长度,返回盐和哈希后的密码 err只有在生成盐时才可能出错,与底层操作系统或硬件提供的随机数生成器有关,概率很小.
GenerateSalt
GenerateSalt generates a random salt of specified length.
HashPassword
HashPassword hashes a password using PBKDF2 with a given salt and iteration count.
Verify
验证密码是否正确,传入原始密码、哈希后的密码和盐.