cryptutils

Cryptographic Software Utilities
git clone http://git.omkov.net/cryptutils
Log | Tree | Refs | README | LICENCE | Download

cryptutils/src/util/base32.h (27 lines, 551 B) -rw-r--r-- file download

03b01d2 Jamozed 2022-03-06 17:10:01
0
// util/base32.h, version 1.0.4
c01a723 Jamozed 2022-02-05 19:04:03
1
// Base32 header file from libutil
d079bad Jamozed 2021-02-21 23:42:46
2
// Copyright (C) 2021, Jakob Wakeling
03b01d2 Jamozed 2022-03-06 17:10:01
3
// MIT Licence
d079bad Jamozed 2021-02-21 23:42:46
4
c01a723 Jamozed 2022-02-05 19:04:03
5
#ifndef UTIL_BASE32_H_2PSMZTB0
c01a723 Jamozed 2022-02-05 19:04:03
6
#define UTIL_BASE32_H_2PSMZTB0
03b01d2 Jamozed 2022-03-06 17:10:01
7
03b01d2 Jamozed 2022-03-06 17:10:01
8
#ifdef __cplusplus
03b01d2 Jamozed 2022-03-06 17:10:01
9
extern "C" {
03b01d2 Jamozed 2022-03-06 17:10:01
10
#endif
d079bad Jamozed 2021-02-21 23:42:46
11
d079bad Jamozed 2021-02-21 23:42:46
12
#include <stdint.h>
d079bad Jamozed 2021-02-21 23:42:46
13
#include <stdlib.h>
d079bad Jamozed 2021-02-21 23:42:46
14
d079bad Jamozed 2021-02-21 23:42:46
15
#define B32ELEN(x) (((x + 4) / 5) * 8)
d079bad Jamozed 2021-02-21 23:42:46
16
#define B32DLEN(x) (((x + 7) / 8) * 5)
d079bad Jamozed 2021-02-21 23:42:46
17
d079bad Jamozed 2021-02-21 23:42:46
18
extern size_t b32encode(uint8_t *dst, uint8_t *src, size_t len);
d079bad Jamozed 2021-02-21 23:42:46
19
extern size_t b32decode(uint8_t *dst, uint8_t *src, size_t len);
03b01d2 Jamozed 2022-03-06 17:10:01
20
03b01d2 Jamozed 2022-03-06 17:10:01
21
#ifdef __cplusplus
03b01d2 Jamozed 2022-03-06 17:10:01
22
} // extern "C"
03b01d2 Jamozed 2022-03-06 17:10:01
23
#endif
d079bad Jamozed 2021-02-21 23:42:46
24
c01a723 Jamozed 2022-02-05 19:04:03
25
#endif // UTIL_BASE32_H_2PSMZTB0
26