gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libmicrohttpd] 147/156: Added macro for base64 decoded size


From: gnunet
Subject: [libmicrohttpd] 147/156: Added macro for base64 decoded size
Date: Sun, 28 May 2023 17:53:20 +0200

This is an automated email from the git hooks/post-receive script.

karlson2k pushed a commit to tag v0.9.77
in repository libmicrohttpd.

commit 6f80708b754945b84966797a0dec45506f74bbcd
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Thu May 25 20:06:12 2023 +0300

    Added macro for base64 decoded size
---
 src/microhttpd/mhd_str.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/microhttpd/mhd_str.h b/src/microhttpd/mhd_str.h
index f4dc024c..02c8856a 100644
--- a/src/microhttpd/mhd_str.h
+++ b/src/microhttpd/mhd_str.h
@@ -452,6 +452,16 @@ MHD_uint8_to_str_pad (uint8_t val,
 
 #ifdef BAUTH_SUPPORT
 
+/**
+ * Returns the maximum possible size of the Base64 decoded data.
+ * The real recoded size could be up to two bytes smaller.
+ * @param enc_size the size of encoded data, in characters
+ * @return the maximum possible size of the decoded data, in bytes, if
+ *         @a enc_size is valid (properly padded),
+ *         undefined value smaller then @a enc_size if @a enc_size is not valid
+ */
+#define MHD_base64_max_dec_size_(enc_size) (((enc_size) / 4) * 3)
+
 /**
  * Convert Base64 encoded string to binary data.
  * @param base64 the input string with Base64 encoded data, could be NOT zero

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]