diff options
| author | George Halkiadakis <gchalkiadakis@sklavenitis.co.gr> | 2023-04-27 03:47:30 +0300 |
|---|---|---|
| committer | George Halkiadakis <gchalkiadakis@sklavenitis.co.gr> | 2023-04-27 03:47:30 +0300 |
| commit | 059e0d95d0c28bc5060e87e146eaf7411f51bf90 (patch) | |
| tree | 7c21ac432f16dde2329a0d5954d70711eceb48e6 /tests/compare/sha1-v-sha256.php | |
| parent | 26cd8ee99659ef1926c96a049c93645ffc9b169d (diff) | |
| download | gyraf1gov-059e0d95d0c28bc5060e87e146eaf7411f51bf90.tar.gz gyraf1gov-059e0d95d0c28bc5060e87e146eaf7411f51bf90.tar.bz2 gyraf1gov-059e0d95d0c28bc5060e87e146eaf7411f51bf90.zip | |
skeleton commit; based on an anom project
Diffstat (limited to 'tests/compare/sha1-v-sha256.php')
| -rwxr-xr-x | tests/compare/sha1-v-sha256.php | 22 |
1 files changed, 22 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..4d10e7f --- /dev/null +++ b/tests/compare/sha1-v-sha256.php @@ -0,0 +1,22 @@ +<?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'); +Benchmark::render_report('code'); + +echo "test completed!"; +die(); +
\ No newline at end of file |
