1.0.2 2023-12-13 21:13 UTC

This package is auto-updated.

Last update: 2024-05-13 22:06:24 UTC


README

composer require krzysztofzylka/hash

Methods

Hash string

\Krzysztofzylka\Hash\Hash::hash(string $string, string $algorithm = 'pbkdf2'): string

Check hash

\Krzysztofzylka\Hash\Hash::checkHash(string $hash, string $string): bool

Example

$hash = \Krzysztofzylka\Hash\Hash::hash('hash');
$checkHash = \Krzysztofzylka\Hash\Hash::checkHash($hash, 'hash');
$checkHash2 = \Krzysztofzylka\Hash\Hash::checkHash($hash, 'test');

var_dump(
    $hash, //$003$e661174850a6c7fcf99a
    $checkHash, //true
    $checkHash2 //false
);