NAME
base32_fmt, base32_scan - base32 encode/decode a byte array
SYNOPSIS
#include <limb/base32.h>
size_t base32_fmt(char *dst, const void *data, size_t dlen, int strict) ssize_t base32_scan(char *dst, const char *data, size_t dlen, int strict)
DESCRIPTION
The base32_fmt
() function will encode the byte array pointed to by data
of
length dlen
bytes into the byte array pointed to by dst
using the base32
algorithm as described in RFC 4648, unless strict
is zero in which
case when padding is needed, only one padding character is used.
Refer to base_fmt(3) for more details.
The base32_scan
() function will decode the byte array pointed to by data
of
length dlen
into the byte array pointed to be dst
using the base32 algorithm
as described in RFC 4648, unless strict
is zero if which case it
accepts a single padding character to indicate padding.
Refer to base_scan(3) for more details.
RETURN VALUE
The base32_fmt
() function return the length written into dst
- or that
would have been when dst
is NULL.
The base32_scan
() function return the length written into dst
- or that
would have been when dst
is NULL - on success. Otherwise it returns -1 and
sets errno
to indicate the error.
ERRORS
The base32_scan
() function may fail for any of the errors described for
base_scan(3) except ERANGE.