I found this mentioned in a old user comment (it might not be relevant now):
"Some quick reverse engineering shows they're using the standard CRC32
parameters:

Polynomial 0x04C11DB7l
Initial register value 0xFFFFFFFF
Register is inverted at end of calculation
Bytes are reflected as they come in, and the result is reflected before it
is returned.

The documentation says this function returns the CRC polynomial of the
string - that's a little misleading IMHO. I'd say it simply returns the CRC
of the string. The polynomial is a magic number in the calculation."

and I've just downloaded the lastest source and found the crc32 function to
be in crc32.c and crc32.h. In the comments it mentions that the polynomial
is
/* generated using the AUTODIN II polynomial
 * x^32 + x^26 + x^23 + x^22 + x^16 +
 * x^12 + x^11 + x^10 + x^8 + x^7 + x^5 + x^4 + x^2 + x^1 + 1
 */

and there is a big table of 256 number which you may find useful.

Oh finally I also found mentioned in the NEWS file that:
"- Added a crc32 checksum function - used by the UdmSearch search engine
  and currently run through a system call.  This will speed up the UdmSearch
  php frontend significantly. (Rasmus)"

Which seems to be called udm_crc32, and so far undocumented.

I hope this information has been useful.
Andrew
----- Original Message -----
From: "Methusula" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, August 22, 2003 1:01 PM
Subject: [PHP] CRC and Polynomials


> Hi,
>
> Can anyone tell me which 32-bit polynomial is used by PHP in the crc
> function? I am trying to write a crc function from scratch, however, php
> does not appear to use any of the most commonly used polynomial divisors.
>
> Methusula.
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to