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