aboutsummaryrefslogtreecommitdiff
path: root/src/base64.cpp
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2016-04-26 18:10:13 +0100
committerRichard van der Hoff <richard@matrix.org>2016-04-26 18:10:13 +0100
commit11dbf2aab3e9a65148a40ac6b5b1124929344c1a (patch)
tree6550798794f5df40bcd86cd151efcc2027b0cca3 /src/base64.cpp
parent9b010290a49243e5867dd9d4c93784a345fb2637 (diff)
Fix a bunch of compiler warnings, and turn on warnings.
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