libbtc
bitcoinclibrary
|
#include <stdint.h>
#include <stddef.h>
Go to the source code of this file.
Macros | |
#define | TO_UINT8_HEX_BUF_LEN 2048 |
#define | VARINT_LEN 20 |
#define | strlens(s) (s == NULL ? 0 : strlen(s)) |
Functions | |
void | utils_clear_buffers (void) |
void | utils_hex_to_bin (const char *str, unsigned char *out, int inLen, int *outLen) |
void | utils_bin_to_hex (unsigned char *bin_in, size_t inlen, char *hex_out) |
uint8_t * | utils_hex_to_uint8 (const char *str) |
char * | utils_uint8_to_hex (const uint8_t *bin, size_t l) |
void | utils_reverse_hex (char *h, int len) |
void | utils_uint64_to_varint (char *vi, int *l, uint64_t i) |
int | utils_varint_to_uint64 (const char *vi, uint64_t *i) |
#define strlens | ( | s | ) | (s == NULL ? 0 : strlen(s)) |
Definition at line 40 of file utils.h.
Referenced by btc_hd_generate_key(), and utils_hex_to_uint8().
#define TO_UINT8_HEX_BUF_LEN 2048 |
Definition at line 37 of file utils.h.
Referenced by utils_clear_buffers(), utils_hex_to_uint8(), and utils_uint8_to_hex().
#define VARINT_LEN 20 |
Definition at line 38 of file utils.h.
Referenced by utils_uint64_to_varint(), and utils_varint_to_uint64().
void utils_bin_to_hex | ( | unsigned char * | bin_in, |
size_t | inlen, | ||
char * | hex_out | ||
) |
void utils_clear_buffers | ( | void | ) |
Definition at line 40 of file utils.c.
References buffer_hex_to_uint8, buffer_uint8_to_hex, and TO_UINT8_HEX_BUF_LEN.
void utils_hex_to_bin | ( | const char * | str, |
unsigned char * | out, | ||
int | inLen, | ||
int * | outLen | ||
) |
uint8_t* utils_hex_to_uint8 | ( | const char * | str | ) |
Definition at line 77 of file utils.c.
References buffer_hex_to_uint8, strlens, and TO_UINT8_HEX_BUF_LEN.
void utils_reverse_hex | ( | char * | h, |
int | len | ||
) |
Definition at line 140 of file utils.c.
References const_buffer::len.
Referenced by utils_uint64_to_varint(), and utils_varint_to_uint64().
void utils_uint64_to_varint | ( | char * | vi, |
int * | l, | ||
uint64_t | i | ||
) |
Definition at line 152 of file utils.c.
References const_buffer::len, utils_reverse_hex(), and VARINT_LEN.
char* utils_uint8_to_hex | ( | const uint8_t * | bin, |
size_t | l | ||
) |
int utils_varint_to_uint64 | ( | const char * | vi, |
uint64_t * | i | ||
) |
Definition at line 186 of file utils.c.
References const_buffer::len, utils_reverse_hex(), and VARINT_LEN.