limb 0.2.0

2024-01-09

buffer_putbase32(3)
limb manual
buffer_putbase32(3)

NAME

buffer_putbase32, buffer_putbase64 - write byte array content encoded in base32/base64 into buffer

SYNOPSIS

#include <limb/buffer.h>
ssize_t buffer_putbase32(buffer *buf, const char *data, size_t dlen, int pad)
ssize_t buffer_putbase64(buffer *buf, const char *data, size_t dlen, int pad)

DESCRIPTION

The buffer_putbase32() function writes the content of byte array pointed to by data of length dlen bytes into buffer buf encoded in base32. Padding will be used in the output unless pad is zero.

For more about the encoding, refer to base32_fmt(3).

The buffer_putbase64() function writes the content of byte array pointed to by data of length dlen bytes into buffer buf encoded in base64. Padding will be used in the output unless pad is zero.

For more about the encoding, refer to base64_fmt(3).

RETURN VALUE

These functions return the number of bytes written into buf on success. Otherwise, they return -1 and set errno to indicate the error.

ERRORS

These functions may fail and set errno for any of the errors specified for buffer_put(3).

limb 0.1.0
2023-07-24
buffer_putbase32(3)