self::BCRYPT_COST] ); return $passwordHash; } /** * Verify the given password is valid. * * A valid password is a string of at least 7 characters. * * @return bool True if the password is valid, false otherwise */ public static function check(string $password): bool { return strlen($password) >= 7; } public static function cryptAvailable(): bool { $hash = '$2y$04$usesomesillystringfore7hnbRJHxXVLeakoG8K30oukPsA.ztMG'; return $hash === @crypt('password', $hash); } }