From 02608271bb2a9f3a65ed536984d306ee14b48e34 Mon Sep 17 00:00:00 2001 From: Geo Halkiadakis Date: Sun, 12 Jul 2026 15:51:52 +0300 Subject: initialize repository; add docker config; migrate configuration to new specs --- tests/compare/sha1-v-sha256.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 tests/compare/sha1-v-sha256.php (limited to 'tests/compare/sha1-v-sha256.php') diff --git a/tests/compare/sha1-v-sha256.php b/tests/compare/sha1-v-sha256.php new file mode 100755 index 0000000..d4bf5dc --- /dev/null +++ b/tests/compare/sha1-v-sha256.php @@ -0,0 +1,23 @@ +'; +echo "\nsha1: ". sha1('hello'); +echo "\nsha256: ". hash('sha256', 'hello'); +echo ''; +ob_flush(); + +Benchmark::add_spot('100.000 x sha1'); +for($i = 0 ; $i<100000 ; $i++) $x = sha1($i); + + +Benchmark::add_spot('100.000 x sha256'); +for($i = 0 ; $i<100000 ; $i++) $x = hash('sha256', $i); + +Benchmark::add_spot('end'); + +echo (Benchmark::report(BENCH_REPORT_COMMENT)); + +echo "test completed!"; +die(); + \ No newline at end of file -- cgit v1.2.3