php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48284 hash "adler32" byte order is reversed
Submitted: 2009-05-14 16:20 UTC Modified: 2009-08-12 00:22 UTC
From: tyler dot reese at taqua dot com Assigned: scottmac (profile)
Status: Closed Package: hash related
PHP Version: 5.2.9 OS: *
Private report: No CVE-ID: None
 [2009-05-14 16:20 UTC] 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-06-30 13:23 UTC] scottmac@php.net
Fixed in trunk and for 5.3.1, will do 5.2 shortly.
 [2009-08-12 00:18 UTC] svn@php.net
Automatic comment from SVN on behalf of scottmac
Revision: http://svn.php.net/viewvc/?view=revision&revision=287127
Log: MFB 5.3: Fix bug #48284 (r283144) - adler32 is in the wrong order. Changed to match what zlib produces.
 [2009-08-12 00:22 UTC] scottmac@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 02:01:28 2024 UTC