⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 testbase64encode.cpp

📁 UDP对QQ来说太重要了。 UDP和TCP是同一个层上的协议
💻 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 + -