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

Function base64_encode_triplet_using_maps

ccan/ccan/base64/base64.c:63–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61}
62
63void base64_encode_triplet_using_maps(const base64_maps_t *maps,
64 char dest[4], const char src[3])
65{
66 char a = src[0];
67 char b = src[1];
68 char c = src[2];
69
70 dest[0] = sixbit_to_b64(maps, (a & 0xfc) >> 2);
71 dest[1] = sixbit_to_b64(maps, ((a & 0x3) << 4) | ((b & 0xf0) >> 4));
72 dest[2] = sixbit_to_b64(maps, ((c & 0xc0) >> 6) | ((b & 0xf) << 2));
73 dest[3] = sixbit_to_b64(maps, c & 0x3f);
74}
75
76void base64_encode_tail_using_maps(const base64_maps_t *maps, char dest[4],
77 const char *src, const size_t srclen)

Callers 3

base64_encode_using_mapsFunction · 0.85
base64_encode_tripletFunction · 0.85

Calls 1

sixbit_to_b64Function · 0.85

Tested by

no test coverage detected