summaryrefslogtreecommitdiff
path: root/src/lib/emile/emile_base64.h
blob: 7e677458a2a90b2e84de8200bcafbd159d315f75 (plain) (blame)
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
#ifndef EMILE_BASE64_H_
#define EMILE_BASE64_H_

/**
 * @defgroup Emile_Group_Base64 Non destructive base64 manipulation functions.
 * @ingroup Emile
 * Function that allow the encoding and decoding of base64 Eina_Binbuf.
 *
 * @{
 */

/**
 * @brief base64 encoding function.
 * @param in The buffer to be encoded.
 * @return the base64 encoded string.
 *
 * This will create a string which is base64 encode of the buffer. The caller has
 * to free the returned string using eina_strbuf_free().
 *
 * @since 1.17.0
 */
EAPI Eina_Strbuf *emile_base64_encode(const Eina_Binbuf *in);

/**
 * @brief base64 url and filename safe encoding function.
 * @param src The buffer to be encoded.
 * @return the base64 url encoded string.
 *
 * This will create a string which is base64 encoded with url and
 * filename safe alphabet of the src. The caller has to free the
 * returned string using eina_strbuf_free(). There will be no padding in the
 * encoded string.
 *
 * @since 1.17.0
 */
EAPI Eina_Strbuf *emile_base64url_encode(const Eina_Binbuf *in);

/**
 * @brief base64 decoding function.
 * @param src The string to be decoded.
 * @return the base64 decoded buffer.
 *
 * This will create a buffer which is base64 decode of the src.
 * The caller has to free the returned string using eina_binbuf_free().
 *
 * @since 1.17.0
 */
EAPI Eina_Binbuf* emile_base64_decode(const Eina_Strbuf *in);

/**
 * @brief decoding function for base64 url and filename safe encoding.
 * @param src The string to be decoded.
 * @return the base64 url decoded buffer.
 *
 * This will create a buffer which is base64 url decode of the src.
 * The caller has to free the returned string using eina_binbuf_free().
 *
 * @since 1.17.0
 */
EAPI Eina_Binbuf* emile_base64url_decode(const Eina_Strbuf *in);

/**
 * @}
 */
#endif