/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #pragma once #include <cstddef> #include <cstdint> namespace folly::detail::base64_detail { constexpr std::size_t base64EncodedSize(std::size_t inSize) { … } constexpr std::size_t base64URLEncodedSize(std::size_t inSize) { … } // More incorrect usage of '=' padding will be detected during decoding constexpr std::size_t base64PaddingToSubtract(const char* l) { … } // Does not detect errors, all of them will be detected during actual decoding. constexpr std::size_t base64DecodedSize(const char* f, const char* l) { … } constexpr std::size_t base64URLDecodedSize(const char* f, const char* l) { … } struct Base64DecodeResult { … }; } // namespace folly::detail::base64_detail