b64.h
Go to the documentation of this file.
/*
Copyright (C) 2022 The University of Notre Dame
This software is distributed under the GNU General Public License.
See the file COPYING for details.
*/
#ifndef B64_H
#define B64_H
#include "buffer.h"
#include <stddef.h>
static inline size_t b64_size (size_t bloblen)
{
/* Ceil division by 3 multiplied by 4 */
return 1 /* NUL byte */ + (bloblen + 3 - 1) / 3 * 4;
}
int b64_encode(const void *blob, size_t bloblen, buffer_t *b64);
int b64_decode(const char *b64, buffer_t *blob);
#endif /* B64_H */
/* vim: set noexpandtab tabstop=8: */
b64_encode
int b64_encode(const void *blob, size_t bloblen, buffer_t *b64)
Encode a binary blob in base64.
b64_decode
int b64_decode(const char *b64, buffer_t *blob)
Decode a base64 encoded blob.
buffer.h
String Buffer Operations.