libutil

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

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

8a5f06f Jamozed 2022-02-09 20:04:50
0
// util/base64.h, version 1.1.5
98e5939 Jamozed 2021-11-27 17:53:46
1
// Base64 header file from libutil
0becaf1 Jamozed 2021-02-05 02:10:07
2
// Copyright (C) 2021, Jakob Wakeling
7f427d9 Jamozed 2022-03-06 12:55:13
3
// MIT Licence
0becaf1 Jamozed 2021-02-05 02:10:07
4
98e5939 Jamozed 2021-11-27 17:53:46
5
#ifndef UTIL_BASE64_H_5YQ80JRV
98e5939 Jamozed 2021-11-27 17:53:46
6
#define UTIL_BASE64_H_5YQ80JRV
0becaf1 Jamozed 2021-02-05 02:10:07
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
0becaf1 Jamozed 2021-02-05 02:10:07
12
#include <stdint.h>
0becaf1 Jamozed 2021-02-05 02:10:07
13
#include <stdlib.h>
4bec0a5 Jamozed 2021-02-20 23:12:23
14
57a021b Jamozed 2021-02-21 14:04:23
15
#define B64ELEN(x) (((x + 2) / 3) * 4)
57a021b Jamozed 2021-02-21 14:04:23
16
#define B64DLEN(x) (((x + 3) / 4) * 3)
0becaf1 Jamozed 2021-02-05 02:10:07
17
b8e17ee Jamozed 2021-02-05 17:52:29
18
extern size_t b64encode(uint8_t *dst, uint8_t *src, size_t len);
b8e17ee Jamozed 2021-02-05 17:52:29
19
extern size_t b64decode(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
0becaf1 Jamozed 2021-02-05 02:10:07
24
98e5939 Jamozed 2021-11-27 17:53:46
25
#endif // UTIL_BASE64_H_5YQ80JRV
26