chromium/base/base64url.cc

// Copyright 2015 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "base/base64url.h"

#include <stddef.h>

#include <string_view>

#include "base/base64.h"
#include "base/numerics/safe_math.h"
#include "base/strings/string_util.h"
#include "third_party/modp_b64/modp_b64.h"

namespace base {

namespace {

const char kPaddingChar =;

// Base64url maps {+, /} to {-, _} in order for the encoded content to be safe
// to use in a URL. These characters will be translated by this implementation.
const char kBase64Chars[] =;
const char kBase64UrlSafeChars[] =;

class StringViewOrString {};

// Converts the base64url `input` into a plain base64 string.
std::optional<StringViewOrString> Base64ToBase64URL(
    std::string_view input,
    Base64UrlDecodePolicy policy) {}

}  // namespace

void Base64UrlEncode(span<const uint8_t> input,
                     Base64UrlEncodePolicy policy,
                     std::string* output) {}

void Base64UrlEncode(std::string_view input,
                     Base64UrlEncodePolicy policy,
                     std::string* output) {}

bool Base64UrlDecode(std::string_view input,
                     Base64UrlDecodePolicy policy,
                     std::string* output) {}

std::optional<std::vector<uint8_t>> Base64UrlDecode(
    std::string_view input,
    Base64UrlDecodePolicy policy) {}

}  // namespace base