summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Wallner <mike@php.net>2005-12-03 10:18:38 +0000
committerMichael Wallner <mike@php.net>2005-12-03 10:18:38 +0000
commitf5fae65194549d6cbd1812bcd4cd38cceb657f1e (patch)
tree39c23c9f9b2c02f4a324c396e441f55a6018ee71
parentbde40a73dbdffb52591fb0cc833278c775df3ac9 (diff)
downloadphp-git-f5fae65194549d6cbd1812bcd4cd38cceb657f1e.tar.gz
MFH: add crc32 test
-rw-r--r--ext/hash/tests/crc32.phpt36
1 files changed, 36 insertions, 0 deletions
diff --git a/ext/hash/tests/crc32.phpt b/ext/hash/tests/crc32.phpt
new file mode 100644
index 0000000000..c51209c60d
--- /dev/null
+++ b/ext/hash/tests/crc32.phpt
@@ -0,0 +1,36 @@
+--TEST--
+CRC32
+--SKIPIF--
+<?php extension_loaded('hash') or die('skip'); ?>
+--FILE--
+<?php
+echo hash('crc32', ''), "\n";
+echo hash('crc32', 'a'), "\n";
+echo hash('crc32', 'abc'), "\n";
+echo hash('crc32', 'message digest'), "\n";
+echo hash('crc32', 'abcdefghijklmnopqrstuvwxyz'), "\n";
+echo hash('crc32', 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'), "\n";
+echo hash('crc32', '12345678901234567890123456789012345678901234567890123456789012345678901234567890'), "\n";
+echo hash('crc32b', ''), "\n";
+echo hash('crc32b', 'a'), "\n";
+echo hash('crc32b', 'abc'), "\n";
+echo hash('crc32b', 'message digest'), "\n";
+echo hash('crc32b', 'abcdefghijklmnopqrstuvwxyz'), "\n";
+echo hash('crc32b', 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'), "\n";
+echo hash('crc32b', '12345678901234567890123456789012345678901234567890123456789012345678901234567890'), "\n";
+?>
+--EXPECT--
+00000000
+6b9b9319
+73bb8c64
+5703c9bf
+9693bf77
+882174a0
+96790816
+00000000
+43beb7e8
+c2412435
+7f9d1520
+bd50274c
+d2e6c21f
+724aa97c