Embedded SDK
Embedded SDK
Macros | Functions
base58.h File Reference
#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>
Include dependency graph for base58.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MAX_DEC_INPUT_SIZE   164
 
#define MAX_ENC_INPUT_SIZE   120
 

Functions

int base58_decode (const char *in, size_t in_len, uint8_t *out, size_t out_len)
 
int base58_encode (const uint8_t *in, size_t in_len, char *out, size_t out_len)
 

Macro Definition Documentation

◆ MAX_DEC_INPUT_SIZE

#define MAX_DEC_INPUT_SIZE   164

Maximum length of input when decoding in base 58.

Definition at line 10 of file base58.h.

◆ MAX_ENC_INPUT_SIZE

#define MAX_ENC_INPUT_SIZE   120

Maximum length of input when encoding in base 58.

Definition at line 14 of file base58.h.

Function Documentation

◆ base58_decode()

int base58_decode ( const char *  in,
size_t  in_len,
uint8_t out,
size_t  out_len 
)

Decode input string in base 58.

See also
https://tools.ietf.org/html/draft-msporny-base58-02
Parameters
[in]inPointer to input string buffer.
[in]in_lenLength of the input string buffer.
[out]outPointer to output byte buffer.
[in]out_lenMaximum length to write in output byte buffer.
Returns
number of bytes decoded, -1 otherwise.

Definition at line 45 of file base58.c.

◆ base58_encode()

int base58_encode ( const uint8_t in,
size_t  in_len,
char *  out,
size_t  out_len 
)

Encode input bytes in base 58.

See also
https://tools.ietf.org/html/draft-msporny-base58-02
Parameters
[in]inPointer to input byte buffer.
[in]in_lenLength of the input byte buffer.
[out]outPointer to output string buffer.
[in]out_lenMaximum length to write in output byte buffer.
Returns
number of bytes encoded, -1 otherwise.

Definition at line 108 of file base58.c.