libutil

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

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

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