文字

password_get_info

(PHP 5 >= 5.5.0)

password_get_infoReturns information about the given hash

说明

array password_get_info ( string $hash )

When passed in a valid hash created by an algorithm supported by password_hash() , this function will return an array of information about that hash.

参数

hash

一个由 password_hash() 创建的散列值。

返回值

Returns an associative array with three elements:

  • algo, which will match a password algorithm constant
  • algoName, which has the human readable name of the algorithm
  • options, which includes the options provided when calling password_hash()

用户评论:

[#1] hej at gustav dot tv [2014-04-03 11:14:56]

<?php
var_dump
(password_get_info($hash));
// Example
array(3) {
  [
"algo"]=>
  
int(1)
  [
"algoName"]=>
  
string(6"bcrypt"
  
["options"]=>
  array(
1) {
    [
"cost"]=>
    
int(10)
  }
}

?>

上一篇: 下一篇: