mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Deleted old PHP 5.3 -> 5.4 tiger hash compatibility example. (#926)
This commit is contained in:
parent
f7ee329405
commit
abb0c22310
1 changed files with 0 additions and 40 deletions
|
@ -73,46 +73,6 @@ echo hash('ripemd160', 'The quick brown fox jumped over the lazy dog.');
|
|||
<screen>
|
||||
<![CDATA[
|
||||
ec457d0a974c48d5685a7efa03d137dc8bbde7e3
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
<para>
|
||||
<example xml:id="function.hash.tiger-bc">
|
||||
<title>Calculate pre PHP-5.4 tiger hashes with PHP-5.4 and higher</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
function old_tiger($data = "", $width=192, $rounds = 3) {
|
||||
return substr(
|
||||
implode(
|
||||
array_map(
|
||||
function ($h) {
|
||||
return str_pad(bin2hex(strrev($h)), 16, "0");
|
||||
},
|
||||
str_split(hash("tiger192,$rounds", $data, true), 8)
|
||||
)
|
||||
),
|
||||
0, 48-(192-$width)/4
|
||||
);
|
||||
}
|
||||
echo hash('tiger192,3', 'a-string'), PHP_EOL;
|
||||
echo old_tiger('a-string'), PHP_EOL;
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs.53;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
146a7492719b3564094efe7abbd40a7416fd900179d02773
|
||||
64359b7192746a14740ad4bb7afe4e097327d0790190fd16
|
||||
]]>
|
||||
</screen>
|
||||
&example.outputs.54;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
64359b7192746a14740ad4bb7afe4e097327d0790190fd16
|
||||
146a7492719b3564094efe7abbd40a7416fd900179d02773
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
|
|
Loading…
Reference in a new issue