takashi kadono / Mbed OS Nucleo_446

Dependencies:   ssd1331

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers base64b.h Source File

base64b.h

00001 /*
00002 * Copyright (c) 2018 ARM Limited. All rights reserved.
00003 * SPDX-License-Identifier: Apache-2.0
00004 * Licensed under the Apache License, Version 2.0 (the License); you may
00005 * not use this file except in compliance with the License.
00006 * You may obtain a copy of the License at
00007 *
00008 * http://www.apache.org/licenses/LICENSE-2.0
00009 *
00010 * Unless required by applicable law or agreed to in writing, software
00011 * distributed under the License is distributed on an AS IS BASIS, WITHOUT
00012 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013 * See the License for the specific language governing permissions and
00014 * limitations under the License.
00015 */
00016 
00017 #include <stdint.h>
00018 #include <stdlib.h>
00019 #include <string>
00020 
00021 typedef enum {
00022     BASE64_SUCCESS = 0,
00023     BASE64_INVALID_PARAMETER = 1,
00024     BASE64_BUFFER_TOO_SMALL = 2,
00025     BASE64_ERROR = 3,
00026 } base64_result_e;
00027 
00028 base64_result_e trng_EncodeBase64(const void *buffer, uint32_t bufferSize, char *string, uint32_t stringSize);
00029 base64_result_e trng_DecodeNBase64(const char *string, uint32_t stringMaxSize, void *buffer, uint32_t bufferSize,
00030                                    uint32_t *lengthWritten, uint32_t *charsProcessed);
00031 
00032