crutch / hash-native
Native PHP hash implementation
Installs: 39
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/crutch/hash-native
Requires
- php: ^7.4 || ^8.0
- crutch/hash: ^1.0
Provides
This package is not auto-updated.
Last update: 2025-10-10 09:50:06 UTC
README
Hash interface
Install
composer require crutch/hash-native
Using
<?php $hasher = new \Crutch\NativeHash\BcryptHash(10); // one argument cost // or $hasher = new \Crutch\NativeHash\Argon2IHash(65536, 4, 1); // arguments: memoryCost, timeCost, threads // or $hasher = new \Crutch\NativeHash\Argon2IdHash(65536, 4, 1); // arguments: memoryCost, timeCost, threads $value = 'password'; $hash = $hasher->hash($value); var_dump($hasher->verify($hash, $value)); // true var_dump($hasher->isNeedRehash($hash)); // false