diff options
author | Remi Collet <remi@remirepo.net> | 2024-08-27 15:15:52 +0200 |
---|---|---|
committer | Remi Collet <remi@php.net> | 2024-08-27 15:15:52 +0200 |
commit | 584a1d29a06b6a89873d547039f809c13ccfc392 (patch) | |
tree | 522c2847b2091c27a7aed04367f7c2e991583bec /bench.php | |
parent | cf87d4d8f6db27823242bbe1bd2478ba2b1c1121 (diff) |
add pecl stuff
Diffstat (limited to 'bench.php')
-rw-r--r-- | bench.php | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/bench.php b/bench.php new file mode 100644 index 0000000..a5bc09b --- /dev/null +++ b/bench.php @@ -0,0 +1,37 @@ +<?php + +$deb = microtime(true); +echo 'PASSWORD_BCRYPT: '; +for($i=0; $i<10; $i++) { + $h = password_hash("secret$i", PASSWORD_BCRYPT); +} +printf("%.3f\"\n", microtime(true) - $deb); + +$deb = microtime(true); +echo 'PASSWORD_ARGON2I: '; +for($i=0; $i<10; $i++) { + $h = password_hash("secret$i", PASSWORD_ARGON2I); +} +printf("%.3f\"\n", microtime(true) - $deb); + +$deb = microtime(true); +echo 'PASSWORD_ARGON2ID: '; +for($i=0; $i<10; $i++) { + $h = password_hash("secret$i", PASSWORD_ARGON2ID); +} +printf("%.3f\"\n", microtime(true) - $deb); + +$deb = microtime(true); +echo 'PASSWORD_SHA512: '; +for($i=0; $i<10; $i++) { + $h = password_hash("secret$i", PASSWORD_SHA512); +} +printf("%.3f\"\n", microtime(true) - $deb); + +$deb = microtime(true); +echo 'PASSWORD_YESCRYPT: '; +for($i=0; $i<10; $i++) { + $h = password_hash("secret$i", PASSWORD_YESCRYPT); +} +printf("%.3f\"\n", microtime(true) - $deb); + |