Accept const data for b58check
This commit is contained in:
parent
195033316e
commit
696869093e
4
base58.c
4
base58.c
@ -97,10 +97,10 @@ bool my_dblsha256(void *hash, const void *data, size_t datasz)
|
||||
return b58_sha256_impl(buf, data, datasz) && b58_sha256_impl(hash, buf, sizeof(buf));
|
||||
}
|
||||
|
||||
int b58check(void *bin, size_t binsz, const char *base58str, size_t b58sz)
|
||||
int b58check(const void *bin, size_t binsz, const char *base58str, size_t b58sz)
|
||||
{
|
||||
unsigned char buf[32];
|
||||
unsigned char *binc = bin;
|
||||
const uint8_t *binc = bin;
|
||||
unsigned i;
|
||||
if (!my_dblsha256(buf, bin, binsz - 4))
|
||||
return -2;
|
||||
|
||||
2
base58.h
2
base58.h
@ -7,6 +7,6 @@
|
||||
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(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);
|
||||
|
||||
#endif
|
||||
|
||||
Loading…
Reference in New Issue
Block a user