1<?
php declare(strict_types=1);
25 $knownString .= chr(0);
26 $userString .= chr(0);
28 $known_string_length = strlen($knownString);
29 $user_string_length = strlen($userString);
31 $result = $known_string_length - $user_string_length;
33 for (
$i = 0;
$i < $user_string_length;
$i++) {
34 $result |= (ord($knownString[
$i % $known_string_length]) ^ ord($userString[
$i]));
An exception for terminatinating execution or to throw for unit testing.
requiresSalt()
@inheritDoc
isPasswordTooLong(string $password)
Checks if the password is too long.
isSupportedByRuntime()
@inheritDoc
comparePasswords(string $knownString, string $userString)
Compares two passwords.
requiresReencoding(string $encoded)
@inheritDoc
const MAX_PASSWORD_LENGTH