note 118012 added to function.password-hash
| From: | lortet | Date: | Fri, 18 Sep 2015 08:52:02 +0000 |
| Subject: | note 118012 added to function.password-hash | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-203807@lists.php.net to get a copy of this message | ||
The PASSWORD_BCRYPT duration evolves exponentially based on COST.
Measure picture : https://static.lortet.io/files/php.net.bcrypt_evolves.png
The "constant" depends on your machine (for me is 1).
Method :
<table border="1">
<?php
for( $cost = 0; $cost <= 10; $cost=$cost+0.1){
$start = microtime(true);
password_hash("test".$cost, PASSWORD_BCRYPT, ["cost" => $cost]);
$end = microtime(true);
echo '<tr><td>' . $cost . '</td><td>' . ( $end -
$start ) . '</td></tr>';
}
?>
</table>
----
Server IP: 72.52.91.14
Probable Submitter: 2a01:e35:8a03:bb80:e597:93de:6296:1cf2
----
Manual Page -- http://php.net/manual/en/function.password-hash.php
Edit -- https://master.php.net/note/edit/118012
Del: integrated -- https://master.php.net/note/delete/118012/integrated
Del: useless -- https://master.php.net/note/delete/118012/useless
Del: bad code -- https://master.php.net/note/delete/118012/bad+code
Del: spam -- https://master.php.net/note/delete/118012/spam
Del: non-english -- https://master.php.net/note/delete/118012/non-english
Del: in docs -- https://master.php.net/note/delete/118012/in+docs
Del: other reasons-- https://master.php.net/note/delete/118012
Reject -- https://master.php.net/note/reject/118012
Search -- https://master.php.net/manage/user-notes.php