| 323 | } |
| 324 | |
| 325 | static 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 | |
| 341 | struct rune *rune_from_base64n(const tal_t *ctx, const char *str, size_t len) |
| 342 | { |