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

Function base64_encode

ccan/ccan/base64/base64.h:146–152  ·  view source on GitHub ↗

* base64_encode - Encode a buffer into base64 according to rfc4648 * @param dest Buffer to encode into * @param destlen Length of the destination buffer * @param src Buffer to encode * @param srclen Length of the data to encode * @return Number of encoded bytes set in dest. -1 on error (and errno set) * @note dest will be nul-padded to destlen (past any required padding) * @note sets errno

Source from the content-addressed store, hash-verified

144 * printf("Returned data of length %zd @%p\n", encoded_length, &dest);
145 */
146static inline
147ssize_t base64_encode(char *dest, size_t destlen,
148 const char *src, size_t srclen)
149{
150 return base64_encode_using_maps(&base64_maps_rfc4648,
151 dest, destlen, src, srclen);
152}
153
154/**
155 * base64_encode_triplet - encode 3 bytes into base64 according to rfc4648

Callers 4

websocket_accept_strFunction · 0.85
mainFunction · 0.85
b64_encodeFunction · 0.85
mainFunction · 0.85

Calls 1

base64_encode_using_mapsFunction · 0.85

Tested by 2

mainFunction · 0.68
mainFunction · 0.68