ircmaxell/password-compat
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|
The "ircmaxell/password-compat" is a PHP package designed to assist developers handle password hashing in a secure way. It is a compatibility library for the proposed simplified password hashing algorithm. The main purpose of this package is to provide forward compatibility with the password_* functions that come with PHP 5.5.
The package "ircmaxell/password-compat" can be used by PHP developers through simple function calls for creating password hashes, verifying hashes, and determining if a password hash needs to be rehashed.
Here is how you can create a password hash:
$hash = password_hash($password, PASSWORD_BCRYPT);
To verify a password hash, use:
if (password_verify($password, $hash)) {
/* Valid */
} else {
/* Invalid */
}
To check if a password hash needs to be rehashed, use:
if (password_verify($password, $hash)) {
if (password_needs_rehash($hash, $algorithm, $options)) {
$hash = password_hash($password, $algorithm, $options);
/* Store new hash in db */
}
}
The documentation for the "ircmaxell/password-compat" package is essentially contained within its readme file in the GitHub repository. The README.md file contains the requirements for using the library, how to install it, and examples of usage. The documentation also provides a link to the PHP RFC for the password hashing API which offers more detailed information on the subject. For more guidance and usage scenarios, developers can consult the source code and issue queue in the GitHub repository.