b64.h File Reference

Base64 Encoding Operations. More...

`#include "buffer.h"`
`#include <stddef.h>`

Go to the source code of this file.

## Functions

int | b64_encode (const void *blob, size_t bloblen, buffer_t *b64)
| Encode a binary blob in base64.
int | b64_decode (const char *b64, buffer_t *blob)
| Decode a base64 encoded blob.

## Detailed Description

Base64 Encoding Operations.

## Function Documentation

## b64_encode()

int b64_encode | ( | const void * | blob,
|  | size_t | bloblen,
|  | buffer_t * | b64 )

Encode a binary blob in base64.

The character array pointed to by b64 must have length of at least b64_size(bloblen).

Parameters

  blob | The input binary blob.
  bloblen | The input length of the binary blob.
  b64 | The output base64 encoded blob.

Returns
  0 on success, -1+errno on error.

## b64_decode()

int b64_decode | ( | const char * | b64,
|  | buffer_t * | blob )

Decode a base64 encoded blob.

The character array pointed to by b64 must have length of at least b64_size(bloblen).

Parameters

  b64 | The input base64 encoded blob.
  blob | The output binary blob.

Returns
  0 on success, -1+errno on error.