资源简介
已经用在项目上。
代码片段和文件信息
/*
* RFC 1521 base64 encoding/decoding
*
* Copyright (C) 2006-2010 Brainspark B.V.
*
* This file is part of PolarSSL (http://www.polarssl.org)
* Lead Maintainer: Paul Bakker
*
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not write to the Free Software Foundation Inc.
* 51 Franklin Street Fifth Floor Boston MA 02110-1301 USA.
*/
#include “stm32f10x.h“
#if 1 //defined(POLARSSL_base64_C)
#include “base64.h“
//#ifdef _MSC_VER
//#include setsd.h>
//typedef UINT32 uint32_t;
//#else
//#include
//#endif
static const unsigned char base64_enc_map[64] =
{
‘A‘ ‘B‘ ‘C‘ ‘D‘ ‘E‘ ‘F‘ ‘G‘ ‘H‘ ‘I‘ ‘J‘
‘K‘ ‘L‘ ‘M‘ ‘N‘ ‘O‘ ‘P‘ ‘Q‘ ‘R‘ ‘S‘ ‘T‘
‘U‘ ‘V‘ ‘W‘ ‘X‘ ‘Y‘ ‘Z‘ ‘a‘ ‘b‘ ‘c‘ ‘d‘
‘e‘ ‘f‘ ‘g‘ ‘h‘ ‘i‘ ‘j‘ ‘k‘ ‘l‘ ‘m‘ ‘n‘
‘o‘ ‘p‘ ‘q‘ ‘r‘ ‘s‘ ‘t‘ ‘u‘ ‘v‘ ‘w‘ ‘x‘
‘y‘ ‘z‘ ‘0‘ ‘1‘ ‘2‘ ‘3‘ ‘4‘ ‘5‘ ‘6‘ ‘7‘
‘8‘ ‘9‘ ‘+‘ ‘/‘
};
static const unsigned char base64_dec_map[128] =
{
127 127 127 127 127 127 127 127 127 127
127 127 127 127 127 127 127 127 127 127
127 127 127 127 127 127 127 127 127 127
127 127 127 127 127 127 127 127 127 127
127 127 127 62 127 127 127 63 52 53
54 55 56 57 58 59 60 61 127 127
127 64 127 127 127 0 1 2 3 4
5 6 7 8 9 10 11 12 13 14
15 16 17 18 19 20 21 22 23 24
25 127 127 127 127 127 127 26 27 28
29 30 31 32 33 34 35 36 37 38
39 40 41 42 43 44 45 46 47 48
49 50 51 127 127 127 127 127
};
/*
* Encode a buffer into base64 format
*/
int base64_encode( unsigned char *dst size_t *dlen
const unsigned char *src size_t slen )
{
size_t i n;
int C1 C2 C3;
unsigned char *p;
if( slen == 0 )
return( 0 );
n = (slen << 3) / 6;
switch( (slen << 3) - (n * 6) )
{
case 2: n += 3; break;
case 4: n += 2; break;
default: break;
}
if( *dlen < n + 1 )
{
*dlen = n + 1;
return( POLARSSL_ERR_base64_BUFFER_TOO_SMALL );
}
n = (slen / 3) * 3;
for( i =
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 6589 2020-10-29 10:39 STM32F103-ba
文件 3059 2020-10-28 18:28 STM32F103-ba
文件 411 2020-10-29 11:20 STM32F103-ba
目录 0 2020-10-29 11:14 STM32F103-ba
----------- --------- ---------- ----- ----
10059 4
- 上一篇:c++ 求两个数的和
- 下一篇:VC++ 串口
相关资源
- stm32 MQTT
- stm32f103 can驱动
- STM32三菱PLC源码原理图
- SMTP邮件发送程序
- 基于STM32智能家居的无线网关设计与实
-
C++_AES_ECB_ba
se64 - 基于stm32的交通信号灯代码
- DHT11驱动程序基于STM32
- 基于STEM32的倒车记录仪智能报警系统
- STM32_GY25Z计步器
- C语言实现的红外发送STM32F10x单片机应
- stm32L系列F系列 加密库Cryptographic lib
- 心率传感器算法-stm32-实测可用
- 工程使用的STM32版FX2N源码和原理图
- 基于stm32f1的频率计
- stm32F103zet6开串口通信2 C语言
- ADC电压采集程序
- STM32 电子密码锁设计,LCD12864显示C语
- 利用OV7725照相机与STM32F1识别车牌
- 基于STM32的小车红外黑线寻迹代码
- stm32图像采集+QT上位机源码
- STM32,5110液晶显示声纳探鱼器200KHz,
- stm32iap+bootloader+app+mfc上位机
- BMP180气压计STM32例程+51例程+数据手册
-
C++ 实现 3DES加解密ba
se64加解密 - STM32实现俄罗斯方块游戏C语言
- keil基于stm32的模拟交通灯项目源码+文
- STM32F4超声波测距
- HDC1080驱动 温湿度 STM32 IIC I2C
- 语音识别STM_C语言代码
评论
共有 条评论