library hashing
PHP set of libraries for hashing
bmutinda/hashing
PHP set of libraries for hashing
- Sunday, September 17, 2017
- by bmutinda
- Repository
- 1 Watchers
- 0 Stars
- 24 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 2 Versions
- 0 % Grown
1. Bcrypt
Installation
composer require bmutinda/hashing, (*1)
Encrypt (Create a hashed string)
$bcrypt = new \Bmutinda\Hashing\Bcrypt();
$hashed = $bcrypt->hash($password);
Compare hash with a plain string
$bcrypt = new \Bmutinda\Hashing\Bcrypt();
$password = "My plain password";
$hashedPassword = "Long hashed string";
$isValid = $bcrypt->verify($password, $hashedPassword)
Running tests
Run this command from your terminal inside the project root, (*2)
vendor/bin/phpunit tests/, (*3)