?? 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 + -