MCPcopy Create free account
hub / github.com/ElementsProject/lightning / b64_encode

Function b64_encode

common/base64.c:7–16  ·  view source on GitHub ↗

Decode/encode from/to base64, base64 helper functions.*/

Source from the content-addressed store, hash-verified

5
6/* Decode/encode from/to base64, base64 helper functions.*/
7char *b64_encode(const tal_t *ctx, const void *data, size_t len)
8{
9 size_t slen = base64_encoded_length(len), enclen;
10 char *str = tal_arr(ctx, char, slen + 1);
11 enclen = base64_encode(str, slen, data, len);
12 assert(enclen == slen);
13
14 str[enclen] = '\0';
15 return str;
16}
17
18u8 *b64_decode(const tal_t *ctx, const char *str, size_t len)
19{

Callers 4

make_fixed_onionFunction · 0.85
json_signmessagewithkeyFunction · 0.85
runFunction · 0.85
mainFunction · 0.85

Calls 2

base64_encoded_lengthFunction · 0.85
base64_encodeFunction · 0.85

Tested by 1

mainFunction · 0.68