1 Star 4 Fork 1

UFQI/Base62x

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Base62x.class.hpp 2.08 KB
一键复制 编辑 原始数据 按行查看 历史
Wadelau 提交于 2020-02-20 10:59 . minor updt, still not ready
/*
* -Base62x class in C++
* work with base62x.cpp
* Wadelau@{ufqi,hotmail}.com
* Refers to
http://ieeexplore.ieee.org/xpl/freeabs_all.jsp?arnumber=6020065
-GitHub-Wadelau , base62x.c
https://github.com/wadelau/Base62x
https://ufqi.com/dev/base62x/?_via=-naturedns
* v1.0, Mon Feb 17 03:26:48 UTC 2020
* @todo, not ready!
*/
#include <iostream>
# include <string>
# include <cstring>
# include <sstream>
# include <cstdlib>
using namespace std;
class Base62x {
//- variables
public:
bool isdebug;
int i;
int codetype; //- 0:encode; 1: decode
static const char xtag = 'x';
string enc;
string dec;
string deg;
string cvtn;
string b62x;
static const int bpos = 60; /* 0-60 chars */
static const int xpos = 64; /* b62x[64] = 'x' */
unsigned char rb62x[xpos*2]; /* reverse in decode block */
int bint[xpos]; /* special handling for x1, x2, x3 *1 */
static const int ascmax = 127;
string asclist;
int ascidx[ascmax+1];
int ascrlist[ascmax+1];
static const int max_safe_base = 36;
static const float ver = 1.2; // Mon Feb 17 03:38:49 UTC 2020
//- constructor
Base62x(){
//- init.
isdebug = true;
codetype = 0;
enc = "-enc";
dec = "-dec";
deg = "-v";
cvtn = "-n";
b62x = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwyz123x";
asclist = "4567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwyz";
}
//- methods, public
public:
char* encode(char* input, int ibase){
char* output;
//- @todo
return output;
}
public:
char* decode(char* input, int obase){
char* output;
//- @todo
return output;
}
public:
int xx2dec(unsigned char *input, int base, int safebase, unsigned char ridx[]){
return i;
}
public:
void dec2xx(long long num, int base, unsigned char *out, char idx[]){
i = num;
}
//- methods, private
private:
long getNum(char* x){
long l = 0;
return l;
}
};
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/xenxin/Base62x.git
[email protected]:xenxin/Base62x.git
xenxin
Base62x
Base62x
master

搜索帮助