reference/password/functions/password-verify.xml
ba9021d03c30d208158471c45dc83613e3159edf
...
...
@@ -65,11 +65,15 @@
65
65
<para>
66
66
<example>
67
67
<title><function>password_verify</function> example</title>
68
+
<para>
69
+
This is a simplified example; it is recommended to rehash a correct password
70
+
if necessary; see <function>password_needs_rehash</function> for an example.
71
+
</para>
68
72
<programlisting role="php">
69
73
<![CDATA[
70
74
<?php
71
75
// See the password_hash() example to see where this came from.
72
-
$hash = '$2y$07$BCryptRequires22Chrcte/VlQH0piJtjXl.0t1XkA8pw9dMXTpOq';
76
+
$hash = '$2y$10$.vGA1O9wmRjrwAVXD98HNOgsNpDczlqm3Jq7KnEd1rVAGv3Fykk1a';
73
77

74
78
if (password_verify('rasmuslerdorf', $hash)) {
75
79
echo 'Password is valid!';
...
...
@@ -93,6 +97,7 @@ Password is valid!
93
97
&reftitle.seealso;
94
98
<para>
95
99
<simplelist>
100
+
<member><function>password_needs_rehash</function></member>
96
101
<member><function>password_hash</function></member>
97
102
<member><link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="&url.password.compat;">userland implementation</link></member>
98
103
<member><function>sodium_crypto_pwhash_str_verify</function></member>
99
104