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 | |
parent | cf87d4d8f6db27823242bbe1bd2478ba2b1c1121 (diff) |
add pecl stuff
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | CREDITS | 2 | ||||
-rw-r--r-- | bench.php | 37 | ||||
-rw-r--r-- | package.xml | 63 |
4 files changed, 103 insertions, 0 deletions
@@ -42,3 +42,4 @@ tests/**/*.sh tests/**/*.db tests/**/*.mem tmp-php.ini +xpass-*.tgz @@ -0,0 +1,2 @@ +xpass +Remi Collet 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); + diff --git a/package.xml b/package.xml new file mode 100644 index 0000000..ca7d161 --- /dev/null +++ b/package.xml @@ -0,0 +1,63 @@ +<?xml version="1.0" encoding="UTF-8"?> +<package xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" packagerversion="1.8.0" version="2.0" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0 http://pear.php.net/dtd/tasks-1.0.xsd http://pear.php.net/dtd/package-2.0 http://pear.php.net/dtd/package-2.0.xsd"> + <name>xpass</name> + <channel>pecl.php.net</channel> + <summary>Extended password extension</summary> + <description> +This extension provides password hashing algorithms used by Linux distributions, +using extended crypt library (libxcrypt). + +* sha512 provided for legacy as used on some old distributions +* yescrypt used on modern distributions +</description> + <lead> + <name>Remi Collet</name> + <user>remi</user> + <email>remi@php.net</email> + <active>yes</active> + </lead> + <date>2024-08-27</date> + <version> + <release>1.0.0dev</release> + <api>1.0.0</api> + </version> + <stability> + <release>stable</release> + <api>stable</api> + </stability> + <license uri="https://www.php.net/license/3_01.txt" filesource="LICENSE">PHP-3.01</license> + <notes> +- first release + </notes> + <contents> + <dir name="/"> + <!-- sources --> + <file name="config.m4" role="src"/> + <file name="php_xpass.h" role="src" /> + <file name="xpass.c" role="src"/> + <!-- documentation --> + <file name="CREDITS" role="doc"/> + <file name="LICENSE" role="doc"/> + <file name="README.md" role="doc"/> + <dir name ="tests"> + <file name="sha512.phpt" role="test"/> + <file name="xpass.phpt" role="test"/> + <file name="yescrypt.phpt" role="test"/> + </dir> + </dir> + </contents> + <dependencies> + <required> + <php> + <min>8.0.0</min> + </php> + <pearinstaller> + <min>1.10.0</min> + </pearinstaller> + </required> + </dependencies> + <providesextension>xpass</providesextension> + <extsrcrelease/> + <changelog> + </changelog> +</package> |