API
#crypto/password
Xu 0.8.8 API
import: #crypto/password
counts: 4 函数, 0 方法, 0 类型, 0 常量, 0 方法集
标准库包 `#crypto/password`。
pbkdf2_hmac_sha256
pub fn pbkdf2_hmac_sha256(password string, salt string, iterations int, key_len int) string
用途
pbkdf2HMACSHA-256。失败时 throw。
参数
password string- password(string)
salt string- salt(string)
iterations int- iterations(int)
key_len int- key_len(int)
返回
string — 结果字符串
hash
pub fn hash(password string) string
用途
哈希。
参数
password string- password(string)
返回
string — 结果字符串
hash_iter
pub fn hash_iter(password string, iterations int) string
用途
哈希iter。失败时 throw。
参数
password string- password(string)
iterations int- iterations(int)
返回
string — 结果字符串
verify
pub fn verify(encoded string, password string) bool
用途
验签。
参数
encoded string- encoded(string)
password string- password(string)
返回
bool — 是否成立