coreutils

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

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

cdfecb8 Jamozed 2022-03-06 15:11:25
0
// util/base64.h, version 1.1.5
b181413 Jamozed 2022-02-05 22:32:00
1
// Base64 header file from libutil
2b96aba Jamozed 2021-02-06 00:50:02
2
// Copyright (C) 2021, Jakob Wakeling
cdfecb8 Jamozed 2022-03-06 15:11:25
3
// MIT Licence
2b96aba Jamozed 2021-02-06 00:50:02
4
b181413 Jamozed 2022-02-05 22:32:00
5
#ifndef UTIL_BASE64_H_5YQ80JRV
b181413 Jamozed 2022-02-05 22:32:00
6
#define UTIL_BASE64_H_5YQ80JRV
cdfecb8 Jamozed 2022-03-06 15:11:25
7
cdfecb8 Jamozed 2022-03-06 15:11:25
8
#ifdef __cplusplus
cdfecb8 Jamozed 2022-03-06 15:11:25
9
extern "C" {
cdfecb8 Jamozed 2022-03-06 15:11:25
10
#endif
2b96aba Jamozed 2021-02-06 00:50:02
11
2b96aba Jamozed 2021-02-06 00:50:02
12
#include <stdint.h>
2b96aba Jamozed 2021-02-06 00:50:02
13
#include <stdlib.h>
2b96aba Jamozed 2021-02-06 00:50:02
14
b181413 Jamozed 2022-02-05 22:32:00
15
#define B64ELEN(x) (((x + 2) / 3) * 4)
b181413 Jamozed 2022-02-05 22:32:00
16
#define B64DLEN(x) (((x + 3) / 4) * 3)
b181413 Jamozed 2022-02-05 22:32:00
17
2b96aba Jamozed 2021-02-06 00:50:02
18
extern size_t b64encode(uint8_t *dst, uint8_t *src, size_t len);
2b96aba Jamozed 2021-02-06 00:50:02
19
extern size_t b64decode(uint8_t *dst, uint8_t *src, size_t len);
cdfecb8 Jamozed 2022-03-06 15:11:25
20
cdfecb8 Jamozed 2022-03-06 15:11:25
21
#ifdef __cplusplus
cdfecb8 Jamozed 2022-03-06 15:11:25
22
} // extern "C"
cdfecb8 Jamozed 2022-03-06 15:11:25
23
#endif
2b96aba Jamozed 2021-02-06 00:50:02
24
b181413 Jamozed 2022-02-05 22:32:00
25
#endif // UTIL_BASE64_H_5YQ80JRV
26