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

Function hex_encode

ccan/ccan/str/hex/hex.c:51–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49}
50
51bool hex_encode(const void *buf, size_t bufsize, char *dest, size_t destsize)
52{
53 size_t i;
54
55 if (destsize < hex_str_size(bufsize))
56 return false;
57
58 for (i = 0; i < bufsize; i++) {
59 unsigned int c = ((const unsigned char *)buf)[i];
60 *(dest++) = hexchar(c >> 4);
61 *(dest++) = hexchar(c & 0xF);
62 }
63 *dest = '\0';
64
65 return true;
66}

Callers 11

bitcoin_txid_to_hexFunction · 0.85
privkey_to_hexstrFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
rune_to_stringFunction · 0.85
log_one_lineFunction · 0.85
tal_hexstrFunction · 0.85
json_add_hexFunction · 0.85
opt_show_secretFunction · 0.85
print_nannounceFunction · 0.85
opt_show_adFunction · 0.85

Calls 2

hex_str_sizeFunction · 0.85
hexcharFunction · 0.85

Tested by 1

mainFunction · 0.68