libutil

C Utility Library
git clone http://git.omkov.net/libutil
Log | Tree | Refs | README | LICENCE | Download

AuthorJamozed <[email protected]>
Date2021-02-20 10:12:23
Commit4bec0a5c8c0fa82d537cd5f19392bdf1077efd06
Parent7750dcd353a9272fcd7df33dd3f914c618357803

base64: Add Base64 length macros

Diffstat

M src/base64.c | 2 +-
M src/base64.h | 5 ++++-

2 files changed, 5 insertions, 2 deletions

diff --git a/src/base64.c b/src/base64.c
index c6d92e7..6f26d9b 100644
--- a/src/base64.c
+++ b/src/base64.c
@@ -1,4 +1,4 @@
-// base64.c, version 1.1.2
+// base64.c, version 1.1.3
 // Base64 source file for OMKOV lib
 // Copyright (C) 2021, Jakob Wakeling
 // All rights reserved.
diff --git a/src/base64.h b/src/base64.h
index 203b02b..b63db1d 100644
--- a/src/base64.h
+++ b/src/base64.h
@@ -1,4 +1,4 @@
-// base64.h, version 1.1.2
+// base64.h, version 1.1.3
 // Base64 header file for OMKOV lib
 // Copyright (C) 2021, Jakob Wakeling
 // All rights reserved.
@@ -36,6 +36,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE.
 #include <stdint.h>
 #include <stdlib.h>
 
+#define B64ELEN(x) (((A + 2) / 3) * 4)
+#define B64DLEN(x) (((A + 3) / 4) * 3)
+
 extern size_t b64encode(uint8_t *dst, uint8_t *src, size_t len);
 extern size_t b64decode(uint8_t *dst, uint8_t *src, size_t len);