📄 patterns.cpp
字号:
#include "stdafx.h"
#include <iostream>
#include "stream/stream.h"
#include "util/util.h"
#include "Patterns/util/md5.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
using namespace std;
void main()
{
string str = "123456789";
protocol::BaseStream stream;
stream.encVmaxString(str, 9);
stream.enc32(123456);
string result;
stream.decVmaxString(result, 9);
u32 val;
stream.dec32(val);
cout << result << endl;
cout << val << endl;
char *input = "1234567890~!@#$%^&*()_+|qwertyuiop[]asdfghjkl;'zxcvbnm,./QWERTYUIOP{}ASDFGHJKL:\"ZXCVBNM<>?";
char output[16];
md5_calc((unsigned char *)output, (unsigned char *)input, strlen(input));
char output2[16];
md5digest(output2, input, strlen(input));
if(memcmp(output, output2, 16) != 0)
{
printf("error\n");
}
else
{
printf("ok");
}
// const int PART_SIZE = 9
// char content[] = "[abc]测试的短消息,this is a test message.";
//
// char *begin = content;
// char *prevBegin = content;
// char *end = content+strlen(content);
// char output[PART_SIZE*2+1] = {0};
//
// while(begin < end)
// {
// size_t howmany = PART_SIZE;
//// stk::takeUCSChar(begin, end, howmany, output);
// output[begin - prevBegin] = '\0';
// prevBegin = begin;
// cout<<howmany<<" "<<output<<endl;
// }
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -