mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 07:04:22 +01:00
Added json_tok_sha256 (#1779)
Added json_tok_sha256 Converted json_tok_tok over a few places. [ Folded: fixed spacing ] Signed-off-by: Mark Beckwith <wythe@intrig.com>
This commit is contained in:
committed by
Rusty Russell
parent
d3edfc8028
commit
1fca7ab562
@@ -158,6 +158,14 @@ bool json_tok_bool(const char *buffer, const jsmntok_t *tok, bool *b)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool json_tok_sha256(const char *buffer, const jsmntok_t * tok,
|
||||
struct sha256 *hash)
|
||||
{
|
||||
return hex_decode(buffer + tok->start,
|
||||
tok->end - tok->start,
|
||||
hash, sizeof(*hash));
|
||||
}
|
||||
|
||||
bool json_tok_tok(const char *buffer, const jsmntok_t * tok,
|
||||
const jsmntok_t **out)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user