c: move c files into nostrdb in prep for switchover
This commit is contained in:
committed by
Daniel D’Aquino
parent
cc75a8450a
commit
954f48b23d
20
nostrdb/hash_u5.h
Normal file
20
nostrdb/hash_u5.h
Normal file
@@ -0,0 +1,20 @@
|
||||
/* bech32 (thus bolt11) deal in 5-bit values */
|
||||
#ifndef LIGHTNING_COMMON_HASH_U5_H
|
||||
#define LIGHTNING_COMMON_HASH_U5_H
|
||||
#include "sha256.h"
|
||||
#include "short_types.h"
|
||||
|
||||
/* Type to annotate a 5 bit value. */
|
||||
typedef unsigned char u5;
|
||||
|
||||
struct hash_u5 {
|
||||
u64 buf;
|
||||
unsigned int num_bits;
|
||||
struct sha256_ctx hash;
|
||||
};
|
||||
|
||||
void hash_u5_init(struct hash_u5 *hu5, const char *hrp);
|
||||
void hash_u5(struct hash_u5 *hu5, const u5 *u5, size_t len);
|
||||
void hash_u5_done(struct hash_u5 *hu5, struct sha256 *res);
|
||||
|
||||
#endif /* LIGHTNING_COMMON_HASH_U5_H */
|
||||
Reference in New Issue
Block a user