-
Notifications
You must be signed in to change notification settings - Fork 0
/
ucenter-authcode-test.cpp
39 lines (27 loc) · 1.21 KB
/
ucenter-authcode-test.cpp
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
26
27
28
29
30
31
32
33
34
35
36
37
38
// ucenter-authcode-test.cpp main
//
#include <stdio.h>
#include <tchar.h>
#include "./ucenter_authcode/ucenter_authcode.h"
#include <iostream>
int main(int argc, _TCHAR* argv[])
{
std::string eng_key = "Adding the gist -r <id> command to read a gist";
std::string eng = "Summary of pull requests, issues opened, and commits. Learn how we count contributions.?!{}[]\\/~!@#$#$%$^^%&*()_+";
ucenter_authcode eng_ua(eng_key);
std::string eng_en = eng_ua.encode(eng);
std::string eng_de = eng_ua.decode(eng_en);
std::cout << "eng_key:" << eng_key << std::endl;
std::cout << "eng:" << eng << std::endl;
std::cout << "eng_en:" << eng_en << std::endl;
std::cout << "eng_de:" << eng_de << std::endl;
std::cout << "eng == eng_de:" << (eng == eng_de) << std::endl;
std::string cn = "向MyCat数据库中插入一条String类型数据,程序使用?!《》{}【】“”’‘、·1234567890-=+—";
std::string cn_en = eng_ua.encode(cn);
std::string cn_de = eng_ua.decode(cn_en);
std::cout << "cn:" << cn << std::endl;
std::cout << "cn_en:" << cn_en << std::endl;
std::cout << "cn_de:" << cn_de << std::endl;
std::cout << "cn == cn_de:" << (cn == cn_de) << std::endl;
return 0;
}