📄 testbase64encode.cpp
字号:
// testBase64Encode.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "../../hmaccess/hmaccess.h"
int main(int argc, char* argv[])
{
int n,m;
char src[]="1234567abcdefgABCDF";
char buf[1024];
printf("source %d bytes :%s\n",strlen(src),src);
if (HMABase64Encode((unsigned char *)src,strlen(src),(unsigned char *)buf,&n)==HMASP_OK)
{
printf("Base64Encode:%s\n",buf);
m=n+10;
if (HMABase64Decode((unsigned char *)buf,n,(unsigned char *)(buf+m),&n)==HMASP_OK)
{
printf("Decode output %d bytes :%s\n",n,buf+m);
if (strncmp(src,buf+m,n)==0)
printf("....OK\n");
else
printf("....ERROR\n");
return 0;
}
}
printf("error.\n");
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -