Neos\Flow\Security\Cryptography\SaltedMd5HashingStrategy::validateSaltedMd5 PHP Méthode

validateSaltedMd5() public static méthode

Use this method to validate hashes generated with generateSlatedMd5().
public static validateSaltedMd5 ( string $clearString, string $hashedStringAndSalt ) : boolean
$clearString string
$hashedStringAndSalt string
Résultat boolean TRUE if the clear string matches, otherwise FALSE
    public static function validateSaltedMd5($clearString, $hashedStringAndSalt)
    {
        if (strpos($hashedStringAndSalt, ',') === false) {
            throw new \InvalidArgumentException('The hashed string must contain a salt, separated with comma from the hashed.', 1269872776);
        }
        list($passwordHash, $salt) = explode(',', $hashedStringAndSalt);
        return md5(md5($clearString) . $salt) === $passwordHash;
    }