bech32_util.h (717B)
1 #ifndef LIGHTNING_COMMON_BECH32_UTIL_H 2 #define LIGHTNING_COMMON_BECH32_UTIL_H 3 #include "config.h" 4 5 #include "tal.h" 6 #include "hash_u5.h" 7 8 /** 9 * Push the bytes in src in 5 bit format onto the end of data. 10 */ 11 void bech32_push_bits(u5 **data, const void *src, size_t nbits); 12 13 /** 14 * Push the bytes in src in 8 bit format onto the end of data. 15 */ 16 void bech32_pull_bits(u8 **data, const u5 *src, size_t nbits); 17 18 /** 19 * Checksumless bech32 routines. 20 */ 21 bool from_bech32_charset(const tal_t *ctx, 22 const char *bech32, size_t bech32_len, 23 char **hrp, u8 **data); 24 25 char *to_bech32_charset(const tal_t *ctx, 26 const char *hrp, const u8 *data); 27 28 #endif /* LIGHTNING_COMMON_BECH32_UTIL_H */