add PASSWORD_ARGON2ID constant (PHP 7.3)

- see https://wiki.php.net/rfc/argon2_password_hash_enhancements
This commit is contained in:
Martin Hujer 2018-11-23 10:30:22 +01:00
parent 67268eaee8
commit 336927cac1
1 changed files with 18 additions and 1 deletions

View File

@ -79,7 +79,7 @@ define("PASSWORD_BCRYPT", 1);
/**
*
* PASSWORD_ARGON2I is used to create new password hashes using the Argon2 algorithm.
* PASSWORD_ARGON2I is used to create new password hashes using the Argon2i algorithm.
*
* Supported Options:
* <ul>
@ -94,6 +94,23 @@ define("PASSWORD_BCRYPT", 1);
*/
define('PASSWORD_ARGON2I', 2);
/**
*
* PASSWORD_ARGON2ID is used to create new password hashes using the Argon2id algorithm.
*
* Supported Options:
* <ul>
* <li>memory_cost (integer) - Maximum memory (in bytes) that may be used to compute the Argon2 hash. Defaults to PASSWORD_ARGON2_DEFAULT_MEMORY_COST.</li>
*
* <li>time_cost (integer) - Maximum amount of time it may take to compute the Argon2 hash. Defaults to PASSWORD_ARGON2_DEFAULT_TIME_COST.</li>
*
* <li>threads (integer) - Number of threads to use for computing the Argon2 hash. Defaults to PASSWORD_ARGON2_DEFAULT_THREADS.</li>
* </ul>
* Available as of PHP 7.3.0.
* @since 7.3
*/
define('PASSWORD_ARGON2ID', 3);
/**
* Default amount of memory in bytes that Argon2lib will use while trying to compute a hash.
* Available as of PHP 7.2.0.