summaryrefslogtreecommitdiff
path: root/include/base64.h
blob: f64c78ebeeae19874a24cb18c1beded206d98886 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#ifndef __CR50_INCLUDE_B64_H
#define __CR50_INCLUDE_B64_H
/* Copyright 2022 The Chromium OS Authors.
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 *
 */

#include "util.h"

/*
 * A function to print base64 encoding of a binary blob on the console.
 *
 * For testing purposed an alternative output function could be supplied.
 *
 * @param data - pointer to data to encode.
 * @param size - size of the data area
 * @param func - optional, function to pass to the characters to print. If
 *               NULL the output is printed on the console.
 */
void base64_encode_to_console(const uint8_t *data, size_t size,
			      void (*func)(char c));

#endif /* ! __CR50_INCLUDE_B64_H */