basteyy / minimal-hash-wrapper
There is no license information available for the latest version (1.0.1) of this package.
A minimal (static) class for hashing and verifying passwords
Package info
github.com/basteyy/minimal-hash-wrapper
Type:libary
pkg:composer/basteyy/minimal-hash-wrapper
1.0.1
2023-11-15 16:52 UTC
Requires (Dev)
- phpunit/phpunit: ^9
This package is auto-updated.
Last update: 2026-02-23 13:47:30 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'; }