|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-11-26 03:31 UTC] php_rar at elberethzone dot net
Description: ------------ The problem is, the value returned by getCRC() is wrong for some entries: Not the true CRC as returned by WinRAR 3.61 or a CRC-32 calculation directly done on the file. As a sidenote, the documentation of this extension indicates getCRC() returns an integer, which is not the case. It returns a string containing the hex representation of the integer. The reproduce code is opening the first RAR of a 26 files set (20 971 520 bytes each). Here is a link to execute the code (if needed): https://darkwater.servegame.com:9091/unrarbug.php I am using Apache 2.2.3 with PHP 5.2.0 and the latest compiled php_rar.dll from PECL (I guess it is 0.3.1 Beta). Reproduce code: --------------- $rarfile = rar_open('DW-PCFX-0001-ZENKI-K3K.part01.rar'); $listentries = rar_list($rarfile); for ($y=0;$y<count($listentries);$y++) { echo str_pad(basename($listentries[$y]->getName()),32, " ", STR_PAD_RIGHT); echo str_pad($listentries[$y]->getUnpackedSize(),16," ",STR_PAD_LEFT).' '; echo str_pad($listentries[$y]->getCrc(),8," ",STR_PAD_LEFT); echo "\n"; } rar_close($rarfile); Expected result: ---------------- DW-PCFX-0001-ZENKI-K3K.bin 773257632 3d7e8c9c DW-PCFX-0001-ZENKI-K3K.cue 909 af8919ff DW-PCFX-0001-ZENKI-K3K.toc.txt 789 6df9c294 Actual result: -------------- DW-PCFX-0001-ZENKI-K3K.bin 773257632 151529 DW-PCFX-0001-ZENKI-K3K.cue 909 af8919ff DW-PCFX-0001-ZENKI-K3K.toc.txt 789 6df9c294 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 05:00:02 2025 UTC |
I get the same result with unrar utility, so it's unrar problem. unrar v dw-v3-test2.part1.rar UNRAR 3.41 freeware Copyright (c) 1993-2004 Alexander Roshal Volume dw-v3-test2.part1.rar Pathname/Comment Size Packed Ratio Date Time Attr CRC Meth Ver ------------------------------------------------------------------------------- pga-sim.cue 100 87 87% 19-01-01 13:35 .....A. CB72AD91 m5g 2.9 pga-sim.bin 2097152 511787 --> 03-01-05 13:19 .....A. 684683A0 m5g 2.9 ------------------------------------------------------------------------------- 2 2097252 511874 24% volume 1