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

Function to_string

ccan/ccan/rune/coding.c:326–340  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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