#48284 [Opn->Asn]: hash "adler32" byte order is reversed
| From: | scottmac@php.net | Date: | Thu, 14 May 2009 16:34:19 +0000 |
| Subject: | #48284 [Opn->Asn]: hash "adler32" byte order is reversed | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-137322@lists.php.net to get a copy of this message | ||
ID: 48284
Updated by: scottmac@php.net
Reported By: tyler dot reese at taqua dot com
-Status: Open
+Status: Assigned
Bug Type: hash related
Operating System: Windows and Linux
PHP Version: 5.2.9
-Assigned To:
+Assigned To: scottmac
Previous Comments:
------------------------------------------------------------------------
[2009-05-14 16:20:44] tyler dot reese at taqua dot com
Description:
------------
I'm using the "adler32" algorithm of the PHP hash() function. The
result that I get has the byte-order reversed from the result I get when
doing the same hash on Python.
From the Python interpreter:
>>> import zlib
>>> hex(zlib.adler32('abc',1))
'0x24d0127'
I saw that a bug addressed this same thing for the crc32 algorithm, but
what about adler32?
Reproduce code:
---------------
<?php
echo hash("adler32","abc");
?>
Expected result:
----------------
24d0127
Actual result:
--------------
27014d02
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=48284&edit=1