1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
|
#ifndef __H_BASE_N__
#define __H_BASE_N__
#include "defs.h"
S_BEGIN_DECLS
/**
* @file
* @defgroup BaseN BaseN
* @addtogroup BaseN
* @{
* https://tools.ietf.org/html/rfc4648
*/
/**
* Encode a Byte array to a Base16 string.
*/
schar *
s_base_16_enc (sbyte * input_data,
size_t in_len,
size_t * out_len);
/**
* Decode a base16 encoded string into a Byte array.
*/
sbyte *
s_base_16_dec (schar * base16_str,
size_t in_len,
size_t * out_len);
/**
* Encode a Byte array to a Base16 string.
*/
schar *
s_base_32_enc (sbyte * input_data,
size_t in_len,
size_t * out_len);
/**
* Decode a base32 encoded string into a Byte array.
*/
sbyte *
s_base_32_dec (schar * base32_str,
size_t in_len,
size_t * out_len);
/**
* Encode a Byte array to a Base32 Hex (Extended hex) string.
*/
schar *
s_base_32_hex_enc (sbyte * input_data,
size_t in_len,
size_t * out_len);
/**
* Decode a base32 Hex (Extended hex) encoded string into a Byte array.
*/
sbyte *
s_base_32_hex_dec (schar * base32_str,
size_t in_len,
size_t * out_len);
/**
* Encode a Byte array to a Base64 string.
*/
schar *
s_base_64_enc (sbyte * input_data,
size_t in_len,
size_t * out_len);
/**
* Decode a base64 encoded string into a Byte array.
*/
sbyte *
s_base_64_dec (schar * base64_str,
size_t in_len,
size_t * out_len);
/**
* Encode a byte array into a URI safe Base64 string.
*/
schar *
s_base_64_safe_enc (sbyte * input_data,
size_t in_len,
size_t * out_len);
/**
* Decode a URI safe Base64 string into a byte array.
*/
sbyte *
s_base_64_safe_dec (schar * base64_str,
size_t in_len,
size_t * out_len);
/**
* @}
*/
S_END_DECLS
#endif __H_BASE_N__
|