libutil

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

AuthorJamozed <[email protected]>
Date2021-02-20 09:58:22
Commit7750dcd353a9272fcd7df33dd3f914c618357803
Parent7bc6501c03f7c99c9d63262bde32ab5f8ea0edd1

base32: Add Base32 length macros

Diffstat

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

2 files changed, 5 insertions, 2 deletions

diff --git a/src/base32.c b/src/base32.c
index beeb02f..76ed533 100644
--- a/src/base32.c
+++ b/src/base32.c
@@ -1,4 +1,4 @@
-// base32.c, version 1.0.1
+// base32.c, version 1.0.2
 // Base32 source file for OMKOV lib
 // Copyright (C) 2021, Jakob Wakeling
 // All rights reserved.
diff --git a/src/base32.h b/src/base32.h
index c4e3ef3..ddb22dc 100644
--- a/src/base32.h
+++ b/src/base32.h
@@ -1,4 +1,4 @@
-// base32.h, version 1.0.1
+// base32.h, version 1.0.2
 // Base32 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 B32ELEN(x) (((x + 4) / 5) * 8)
+#define B32DLEN(x) (((A + 7) / 8) * 5)
+
 extern size_t b32encode(uint8_t *dst, uint8_t *src, size_t len);
 extern size_t b32decode(uint8_t *dst, uint8_t *src, size_t len);