summaryrefslogtreecommitdiff
path: root/tests/compare/sha1-v-sha256.php
diff options
context:
space:
mode:
authorGeorge Halkiadakis <gchalkiadakis@sklavenitis.co.gr>2023-03-12 07:16:23 +0200
committerGeorge Halkiadakis <gchalkiadakis@sklavenitis.co.gr>2023-03-12 07:16:23 +0200
commit7076343338ae3439f3c86f01144818abe8c31978 (patch)
tree794abb1e6b8f821091fd095341885496b6dad51d /tests/compare/sha1-v-sha256.php
parent47cbb529f5723b246125ae083a193e11481b89ef (diff)
downloadclassroom-7076343338ae3439f3c86f01144818abe8c31978.tar.gz
classroom-7076343338ae3439f3c86f01144818abe8c31978.tar.bz2
classroom-7076343338ae3439f3c86f01144818abe8c31978.zip
add container helpers; constuct public directory-tree
Diffstat (limited to 'tests/compare/sha1-v-sha256.php')
-rw-r--r--tests/compare/sha1-v-sha256.php22
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 100644
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