diff options
| author | Geo Halkiadakis <gchalkiadakis@sklavenitis.co.gr> | 2026-07-12 15:51:52 +0300 |
|---|---|---|
| committer | Geo Halkiadakis <gchalkiadakis@sklavenitis.co.gr> | 2026-07-12 15:51:52 +0300 |
| commit | 02608271bb2a9f3a65ed536984d306ee14b48e34 (patch) | |
| tree | 3f23ec48a694ec014e845c4f70d9b5f1c065403c /tests/compare/sha1-v-sha256.php | |
| download | kalassa-master.tar.gz kalassa-master.tar.bz2 kalassa-master.zip | |
Diffstat (limited to 'tests/compare/sha1-v-sha256.php')
| -rwxr-xr-x | tests/compare/sha1-v-sha256.php | 23 |
1 files changed, 23 insertions, 0 deletions
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 @@ +<?php + +echo "test started... "; +echo '<pre>'; +echo "\nsha1: ". sha1('hello'); +echo "\nsha256: ". hash('sha256', 'hello'); +echo '</pre>'; +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 |
