mirror of
https://github.com/php/php-src.git
synced 2024-09-22 02:17:32 +00:00
c3299d7dab
Based on: "Fast CRC Computation for Generic Polynomials Using PCLMULQDQ Instruction" V. Gopal, E. Ozturk, et al., 2009, http://intel.ly/2ySEwL0 Signed-off-by: Frank Du <frank.du@intel.com> Closes GH-6018
43 lines
1.7 KiB
PHP
43 lines
1.7 KiB
PHP
--TEST--
|
|
crc32() function
|
|
--FILE--
|
|
<?php
|
|
$input = array("foo", "bar", "baz", "grldsajkopallkjasd");
|
|
foreach($input AS $i) {
|
|
printf("%u\n", crc32($i));
|
|
}
|
|
printf("%u\n", crc32("1234567890123456"));
|
|
printf("%u\n", crc32("1234567890123456abc"));
|
|
printf("%u\n", crc32("12345678901234561234567890123456"));
|
|
printf("%u\n", crc32("12345678901234561234567890123456abc"));
|
|
printf("%u\n", crc32("123456789012345612345678901234561234567890123456"));
|
|
printf("%u\n", crc32("123456789012345612345678901234561234567890123456abc"));
|
|
printf("%u\n", crc32("1234567890123456123456789012345612345678901234561234567890123456"));
|
|
printf("%u\n", crc32("1234567890123456123456789012345612345678901234561234567890123456abc"));
|
|
printf("%u\n", crc32("12345678901234561234567890123456123456789012345612345678901234561234567890123456"));
|
|
printf("%u\n", crc32("12345678901234561234567890123456123456789012345612345678901234561234567890123456abc"));
|
|
printf("%u\n", crc32("12345678901234561234567890123456123456789012345612345678901234561234567890123456123456789012345612345678901234561234567890123456"));
|
|
printf("%u\n", crc32("12345678901234561234567890123456123456789012345612345678901234561234567890123456123456789012345612345678901234561234567890123456abc"));
|
|
printf("%u\n", crc32("123456789012345612345678901234561234567890123456123456789012345612345678901234561234567890123456123456789012345612345678901234561234567890123456"));
|
|
printf("%u\n", crc32("123456789012345612345678901234561234567890123456123456789012345612345678901234561234567890123456123456789012345612345678901234561234567890123456abc"));
|
|
?>
|
|
--EXPECT--
|
|
2356372769
|
|
1996459178
|
|
2015626392
|
|
824412087
|
|
509595063
|
|
1890929711
|
|
156217630
|
|
941689929
|
|
1939457775
|
|
2213121284
|
|
522627406
|
|
3806880586
|
|
105010221
|
|
1135881371
|
|
640556525
|
|
3081003972
|
|
3751918510
|
|
1076024698
|