b58enc: Accept any kind of pointer for binary data
This commit is contained in:
3
base58.c
3
base58.c
@@ -119,8 +119,9 @@ int b58check(const void *bin, size_t binsz, const char *base58str, size_t b58sz)
|
||||
|
||||
static const char b58digits_ordered[] = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
|
||||
|
||||
bool b58enc(char *b58, size_t *b58sz, const uint8_t *bin, size_t binsz)
|
||||
bool b58enc(char *b58, size_t *b58sz, const void *data, size_t binsz)
|
||||
{
|
||||
const uint8_t *bin = data;
|
||||
int i, j, carry, high, zcount = 0;
|
||||
size_t size;
|
||||
uint8_t *buf;
|
||||
|
||||
3
base58.h
3
base58.h
@@ -3,13 +3,12 @@
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
extern bool (*b58_sha256_impl)(void *, const void *, size_t);
|
||||
|
||||
extern bool b58tobin(void *bin, size_t binsz, const char *b58, size_t b58sz);
|
||||
extern int b58check(const void *bin, size_t binsz, const char *b58, size_t b58sz);
|
||||
|
||||
extern bool b58enc(char *b58, size_t *b58sz, const uint8_t *bin, size_t binsz);
|
||||
extern bool b58enc(char *b58, size_t *b58sz, const void *bin, size_t binsz);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user