Rusty Russell
9 years ago
6 changed files with 27 additions and 13 deletions
@ -0,0 +1,9 @@ |
|||||
|
#include "utils.h" |
||||
|
#include <ccan/str/hex/hex.h> |
||||
|
|
||||
|
char *tal_hexstr(const tal_t *ctx, const void *data, size_t len) |
||||
|
{ |
||||
|
char *str = tal_arr(ctx, char, hex_str_size(len)); |
||||
|
hex_encode(data, len, str, hex_str_size(len)); |
||||
|
return str; |
||||
|
} |
@ -0,0 +1,9 @@ |
|||||
|
#ifndef LIGHTNING_UTILS_H |
||||
|
#define LIGHTNING_UTILS_H |
||||
|
#include "config.h" |
||||
|
#include <ccan/tal/tal.h> |
||||
|
|
||||
|
/* Allocate and fill in a hex-encoded string of this data. */ |
||||
|
char *tal_hexstr(const tal_t *ctx, const void *data, size_t len); |
||||
|
|
||||
|
#endif /* LIGHTNING_UTILS_H */ |
Loading…
Reference in new issue