basteyy / minimal-hash-wrapper
A minimal (static) class for hashing and verifying passwords
Installs: 60
Dependents: 1
Suggesters: 0
Security: 0
Stars: 1
Watchers: 3
Forks: 0
Open Issues: 0
Type:libary
Requires (Dev)
- phpunit/phpunit: ^9
This package is auto-updated.
Last update: 2024-10-23 11:09:21 UTC
README
A minimal (static) class for hashing and verifying passwords
Setup
composer require basteyy/minimal-hash-wrapper
Usage
Create the hash of a password
$userPassword = 'foobar'; $userPasswordHashed = \basteyy\MinimalHashWrapper\MinimalHashWrapper::getHash($userPassword);
Compare hash and a password
if(\basteyy\MinimalHashWrapper\MinimalHashWrapper::compare( $_POST['password'], // From a form for example $user->password // From a database for example )) { echo 'Password was correct. Welcome back user!'; } else { echo 'Okay cowboy .. something is wrong'; }