密码散列算法¶
属性 | 值 |
---|---|
命名空间 | fize\security |
类名 | Password |
方法: |
---|
方法名 | 说明 |
---|---|
getInfo() | 返回指定散列(hash)的相关信息 |
hash() | 创建密码的散列 |
needsRehash() | 检测散列值是否匹配指定的选项 |
verify() | 验证密码是否和散列值匹配 |
方法¶
getInfo()¶
返回指定散列(hash)的相关信息
public static function getInfo (
string $hash
) : array
参数: |
|
---|
hash()¶
创建密码的散列
public static function hash (
string $password,
int $algo,
array $options = null
) : string
参数: |
|
||||||||
---|---|---|---|---|---|---|---|---|---|
返回值: | 失败时返回 false |
needsRehash()¶
检测散列值是否匹配指定的选项
public static function needsRehash (
string $hash,
int $algo,
array $options = null
) : bool
参数: |
|
---|
verify()¶
验证密码是否和散列值匹配
public static function verify (
string $password,
string $hash
) : bool
参数: |
|
---|