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

Function to_string

ccan/ccan/rune/coding.c:325–339  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

323}
324
325static void to_string(struct wbuf *wbuf, const struct rune *rune, u8 *hash32)
326{
327 /* Copy hash in big-endian */
328 for (size_t i = 0; i < 8; i++) {
329 be32 v = cpu_to_be32(rune->shactx.s[i]);
330 memcpy(hash32 + i*4, &v, sizeof(v));
331 }
332
333 for (size_t i = 0; i < tal_count(rune->restrs); i++) {
334 if (i != 0)
335 to_wbuf("&", 1, wbuf);
336 rune_restr_encode(rune->restrs[i], to_wbuf, wbuf);
337 }
338 to_wbuf("", 1, wbuf);
339}
340
341struct rune *rune_from_base64n(const tal_t *ctx, const char *str, size_t len)
342{

Callers 6

rune_to_base64Function · 0.70
rune_to_stringFunction · 0.70
test_keysendFunction · 0.50
test_amount_all_anyFunction · 0.50
test_parse_output_descFunction · 0.50
tlvstreamFunction · 0.50

Calls 3

cpu_to_be32Function · 0.85
to_wbufFunction · 0.85
rune_restr_encodeFunction · 0.85

Tested by 4

test_keysendFunction · 0.40
test_amount_all_anyFunction · 0.40
test_parse_output_descFunction · 0.40
tlvstreamFunction · 0.40