protected static function isBase64Valid(string $encode): bool
    {
        $decode = base64_decode($encode, true);

        if (false === $decode) {
            return false;
        }

        return base64_encode($decode) === $encode;
    }