ParagonIE\Halite\Password::getConfig PHP Méthode

getConfig() protected static méthode

Get the configuration for this version of halite
protected static getConfig ( string $stored ) : SymmetricConfig
$stored string A stored password hash
Résultat SymmetricConfig
    protected static function getConfig(string $stored) : SymmetricConfig
    {
        $length = Util::safeStrlen($stored);
        // This doesn't even have a header.
        if ($length < 8) {
            throw new InvalidMessage('Encrypted password hash is way too short.');
        }
        if (\hash_equals(Util::safeSubstr($stored, 0, 5), Halite::VERSION_PREFIX)) {
            return SymmetricConfig::getConfig(Base64UrlSafe::decode($stored), 'encrypt');
        }
        $v = \Sodium\hex2bin(Util::safeSubstr($stored, 0, 8));
        return SymmetricConfig::getConfig($v, 'encrypt');
    }