PHP 7.2.0 Beta 1 Released

password_get_info

(PHP 5 >= 5.5.0, PHP 7)

password_get_infoReturns information about the given hash

Descrição

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.

Parâmetros

hash

Um hash criado por password_hash().

Valor Retornado

Returns an associative array with three elements:

add a note add a note

User Contributed Notes 2 notes

up
1
lincoln dot du dot j at gmail dot com
9 days ago
<?php

$a
= password_hash("rasmuslerdorf", PASSWORD_DEFAULT);

var_dump(password_get_info($a));
//change every refresh
var_dump($a);

?>

//Output like

array(3) {
  ["algo"]=>
  int(1)
  ["algoName"]=>
  string(6) "bcrypt"
  ["options"]=>
  array(1) {
    ["cost"]=>
    int(10)
  }
}
string(60) "$2y$10$wKEZs6W//QDoOeTKSCXx7.Y9Q7duFEtJpFFuJn1G5GhyWTTit/tL2"
up
-21
hej at gustav dot tv
3 years ago
<?php
var_dump
(password_get_info($hash));
// Example
array(3) {
  [
"algo"]=>
 
int(1)
  [
"algoName"]=>
 
string(6) "bcrypt"
 
["options"]=>
  array(
1) {
    [
"cost"]=>
   
int(10)
  }
}

?>
To Top