- add crc32 test
authorMichael Wallner <mike@php.net>
Sat, 3 Dec 2005 10:16:59 +0000 (10:16 +0000)
committerMichael Wallner <mike@php.net>
Sat, 3 Dec 2005 10:16:59 +0000 (10:16 +0000)
ext/hash/tests/crc32.phpt [new file with mode: 0644]

diff --git a/ext/hash/tests/crc32.phpt b/ext/hash/tests/crc32.phpt
new file mode 100644 (file)
index 0000000..c51209c
--- /dev/null
@@ -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