Zephyr Project API 3.7.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
base64.h
Go to the documentation of this file.
1/*
2 * RFC 1521 base64 encoding/decoding
3 *
4 * Copyright (C) 2018, Nordic Semiconductor ASA
5 * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
6 * SPDX-License-Identifier: Apache-2.0
7 *
8 * Licensed under the Apache License, Version 2.0 (the "License"); you may
9 * not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
16 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 *
20 * Adapted for Zephyr by Carles Cufi (carles.cufi@nordicsemi.no)
21 * - Removed mbedtls_ prefixes
22 * - Reworked coding style
23 */
24#ifndef ZEPHYR_INCLUDE_SYS_BASE64_H_
25#define ZEPHYR_INCLUDE_SYS_BASE64_H_
26
27#include <stddef.h>
28#include <zephyr/types.h>
29
30#ifdef __cplusplus
31extern "C" {
32#endif
33
62int base64_encode(uint8_t *dst, size_t dlen, size_t *olen, const uint8_t *src,
63 size_t slen);
64
81int base64_decode(uint8_t *dst, size_t dlen, size_t *olen, const uint8_t *src,
82 size_t slen);
83
88#ifdef __cplusplus
89}
90#endif
91
92#endif /* ZEPHYR_INCLUDE_SYS_BASE64_H_ */
int base64_decode(uint8_t *dst, size_t dlen, size_t *olen, const uint8_t *src, size_t slen)
Decode a base64-formatted buffer.
int base64_encode(uint8_t *dst, size_t dlen, size_t *olen, const uint8_t *src, size_t slen)
Encode a buffer into base64 format.
__UINT8_TYPE__ uint8_t
Definition stdint.h:88