libbase58check
Library for Base58Check encoding and decoding
|
Functions | |
int | base58check_decode (unsigned char **restrict out, size_t *n_out, const char *restrict in, size_t n_in, size_t n_hdr) |
Decodes data from Base58Check format. More... | |
size_t | base58check_decode_buffer_size (const char *in, size_t n_in, size_t n_pad) |
Returns the recommended size of a buffer to hold the decoding of the specified Base58Check encoding. More... | |
int | base58check_encode (char **restrict out, size_t *n_out, const unsigned char *restrict in, size_t n_in, size_t n_hdr) |
Encodes data in Base58Check format. More... | |
size_t | base58check_encode_buffer_size (const unsigned char *in, size_t n_in, size_t n_pad) |
Returns the recommended size of a buffer to hold the Base58Check encoding of the specified input data. More... | |
void | base58check_free (void *ptr) |
Frees memory allocated by base58check_malloc(). More... | |
void * | base58check_malloc (size_t size) |
Allocates memory. More... | |
int base58check_decode | ( | unsigned char **restrict | out, |
size_t * | n_out, | ||
const char *restrict | in, | ||
size_t | n_in, | ||
size_t | n_hdr | ||
) |
Decodes data from Base58Check format.
[in,out] | out | A pointer to the address of a buffer into which the decoded data are to be written. Must not be If If |
[in,out] | n_out | If Upon return, |
[in] | in | A pointer to the Base58Check encoding to be decoded. Must not be NULL . |
n_in | The size of the Base58Check encoding at in , not including any possible terminator. | |
n_hdr | The number of bytes to skip at *out before writing the decoded data. |
n_in
was too large, *n_out
was too small or too large, n_hdr
was too large, the encoding at in
contained an illegal character, there was a checksum mismatch, or there was a failure to allocate memory. size_t base58check_decode_buffer_size | ( | const char * | in, |
size_t | n_in, | ||
size_t | n_pad | ||
) |
Returns the recommended size of a buffer to hold the decoding of the specified Base58Check encoding.
[in] | in | A pointer to the Base58Check encoding needing to be decoded. Must not be NULL . |
n_in | The size of the Base58Check encoding at in , not including any possible terminator. | |
n_pad | The minimum number of excess bytes to include in the returned estimate. |
SIZE_MAX
upon overflow. int base58check_encode | ( | char **restrict | out, |
size_t * | n_out, | ||
const unsigned char *restrict | in, | ||
size_t | n_in, | ||
size_t | n_hdr | ||
) |
Encodes data in Base58Check format.
[in,out] | out | A pointer to the address of a buffer into which the encoding is to be written. Must not be If If |
[in,out] | n_out | If Upon return, |
[in] | in | A pointer to the input data to be encoded. Must not be NULL . |
n_in | The number of bytes of input data at in . | |
n_hdr | The number of bytes to skip at *out before writing the encoding. |
n_in
was too large, *n_out
was too small or too large, n_hdr
was too large, or there was a failure to allocate memory. size_t base58check_encode_buffer_size | ( | const unsigned char * | in, |
size_t | n_in, | ||
size_t | n_pad | ||
) |
Returns the recommended size of a buffer to hold the Base58Check encoding of the specified input data.
[in] | in | A pointer to the input data needing to be encoded. Must not be NULL . |
n_in | The number of bytes of input data at in . | |
n_pad | The minimum number of excess bytes to include in the returned estimate. |
SIZE_MAX
upon overflow. void base58check_free | ( | void * | ptr | ) |
Frees memory allocated by base58check_malloc().
free
. ptr | A pointer to the memory allocation to be freed. Must have been previously returned by base58check_malloc() and must not be NULL . |
void* base58check_malloc | ( | size_t | size | ) |
Allocates memory.
malloc
. size | The size of the requested allocation. |
NULL
if a memory allocation of the requested size could not be provided. If not NULL
, this pointer must be passed to base58check_free() to free the allocation.