Download src/php/php-src/ext/hash/tests/joaat.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 549 Bytes
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/hash/tests/joaat.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/ext/hash/tests/joaat.phpt
-
curl -L -o joaat.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/ext/hash/tests/joaat.phpt
549 Bytes
| --TEST-- | |
| Hash: Jenkins's one-at-a-time | |
| --FILE-- | |
| $tests = array( | |
| array("hello world", "3e4a5a57"), | |
| array("", 0), | |
| array("", "000000"), | |
| array("a", "ca2e9442"), | |
| array("aa", "7081738e"), | |
| ); | |
| $i = 0; | |
| $pass = true; | |
| foreach ($tests as $test) { | |
| ++$i; | |
| $result = hash("joaat", $test[0]); | |
| if ($result != $test[1]) { | |
| echo "Iteration " . $i . " failed - expected '" . $test[1] . "', got '" . $result . "' for '" . $test[1] . "'\n"; | |
| $pass = false; | |
| } | |
| } | |
| if($pass) { | |
| echo "PASS"; | |
| } | |
| --EXPECT-- | |
| PASS | |