2020-04-26 22:49:19 +02:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
|
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-04-26 22:49:19 +02:00
|
|
|
*/
|
|
|
|
|
2020-05-28 20:40:53 +02:00
|
|
|
#pragma once
|
|
|
|
|
2020-10-13 10:48:48 -04:00
|
|
|
#include <AK/ByteBuffer.h>
|
2022-01-20 17:01:39 +00:00
|
|
|
#include <AK/Error.h>
|
2020-10-13 10:48:48 -04:00
|
|
|
#include <AK/String.h>
|
|
|
|
#include <AK/StringView.h>
|
2020-04-26 22:49:19 +02:00
|
|
|
|
|
|
|
namespace AK {
|
|
|
|
|
2022-06-26 10:20:09 -06:00
|
|
|
[[nodiscard]] size_t calculate_base64_decoded_length(StringView);
|
2020-10-13 10:48:48 -04:00
|
|
|
|
2022-06-26 10:20:09 -06:00
|
|
|
[[nodiscard]] size_t calculate_base64_encoded_length(ReadonlyBytes);
|
2020-10-13 10:48:48 -04:00
|
|
|
|
2022-06-26 10:20:09 -06:00
|
|
|
[[nodiscard]] ErrorOr<ByteBuffer> decode_base64(StringView);
|
2020-06-12 22:09:31 -04:00
|
|
|
|
2022-06-26 10:20:09 -06:00
|
|
|
[[nodiscard]] String encode_base64(ReadonlyBytes);
|
2020-04-26 22:49:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
using AK::decode_base64;
|
2020-06-12 22:09:31 -04:00
|
|
|
using AK::encode_base64;
|