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

Function rune_to_string

ccan/ccan/rune/coding.c:412–426  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

410}
411
412char *rune_to_string(const tal_t *ctx, const struct rune *rune)
413{
414 u8 hash32[32];
415 struct wbuf wbuf;
416
417 /* We're going to prepend hash (in hex), plus colon */
418 wbuf.off = sizeof(hash32) * 2 + 1;
419 wbuf.len = 128;
420 wbuf.buf = tal_arr(ctx, char, wbuf.len);
421
422 to_string(&wbuf, rune, hash32);
423 hex_encode(hash32, sizeof(hash32), wbuf.buf, sizeof(hash32) * 2 + 1);
424 wbuf.buf[sizeof(hash32) * 2] = ':';
425 return wbuf.buf;
426}

Callers 4

mainFunction · 0.85
param_decodableFunction · 0.85
json_add_runeFunction · 0.85
mainFunction · 0.85

Calls 2

hex_encodeFunction · 0.85
to_stringFunction · 0.70

Tested by 1

mainFunction · 0.68