aboutsummaryrefslogtreecommitdiff
path: root/src/base64.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/base64.cpp')
-rw-r--r--src/base64.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/base64.cpp b/src/base64.cpp
index bf8492e..66f512b 100644
--- a/src/base64.cpp
+++ b/src/base64.cpp
@@ -45,6 +45,12 @@ static const std::uint8_t DECODE_BASE64[128] = {
} // namespace
+std::size_t olm::encode_base64_length(
+ std::size_t input_length
+) {
+ return 4 * ((input_length + 2) / 3) + (input_length + 2) % 3 - 2;
+}
+
std::uint8_t * olm::encode_base64(
std::uint8_t const * input, std::size_t input_length,
std::uint8_t * output