#48284 [Asn]: hash "adler32" byte order is reversed

From: Date: Tue, 30 Jun 2009 13:23:48 +0000
Subject: #48284 [Asn]: hash "adler32" byte order is reversed
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-138990@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: Assigned Bug Type: hash related Operating System: * PHP Version: 5.2.9 Assigned To: scottmac New Comment: Fixed in trunk and for 5.3.1, will do 5.2 shortly. 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

« previous php.bugs (#138990) next »