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

Function sixbit_from_b64

ccan/ccan/base64/base64.c:28–40  ·  view source on GitHub ↗

* sixbit_from_b64 - maps a base64-alphabet character to its 6-bit value * @param maps A base 64 maps structure (see base64_init_maps) * @param sixbit Six-bit value to map * @return a six-bit value */

Source from the content-addressed store, hash-verified

26 * @return a six-bit value
27 */
28static int8_t sixbit_from_b64(const base64_maps_t *maps,
29 const unsigned char b64letter)
30{
31 int8_t ret;
32
33 ret = maps->decode_map[(unsigned char)b64letter];
34 if (ret == (int8_t)'\xff') {
35 errno = EDOM;
36 return -1;
37 }
38
39 return ret;
40}
41
42bool base64_char_in_alphabet(const base64_maps_t *maps, const char b64char)
43{

Callers 2

mainFunction · 0.85

Calls

no outgoing calls

Tested by 1

mainFunction · 0.68