首页
社区
课程
招聘
base64解码使用的表为什么是这个样子
发表于: 2011-8-14 19:39 4436

base64解码使用的表为什么是这个样子

2011-8-14 19:39
4436
const BYTE Base64IdxTab[128] =
        {
        255,255,255,255,  255,255,255,255,  255,255,255,255,  255,255,255,255,
        255,255,255,255,  255,255,255,255,  255,255,255,255,  255,255,255,255,
        255,255,255,255,  255,255,255,255,  255,255,255,62,   255,255,255,63,
        52,53,54,55,      56,57,58,59,      60,61,255,255,    255,255,255,255,
        255,0,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,255,     255,255,255,255,
        255,26,27,28,     29,30,31,32,      33,34,35,36,      37,38,39,40,
        41,42,43,44,      45,46,47,48,      49,50,51,255,     255,255,255,255
        };

这个怎么看,为什么会有这么多255?

[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课

收藏
免费 0
支持
分享
最新回复 (6)
雪    币: 47
活跃值: (36)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
2
对于这个  
我没有接触
帮不到你什么
帮你顶起来
2011-8-14 21:19
0
雪    币: 788
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
3
255表示无效数字。
base64,0~127范围内只有64个字符是有用的。
2011-8-14 21:23
0
雪    币: 81
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
4
那为什么是这种排列方式呢,有什么讲究么
2011-8-14 21:53
0
雪    币: 788
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
5
含义就是这个:

Base64IdxTab['+'] = 62;
Base64IdxTab['/'] = 63;
Base64IdxTab['0'] = 52;
Base64IdxTab['1'] = 53;
Base64IdxTab['2'] = 54;
Base64IdxTab['3'] = 55;
Base64IdxTab['4'] = 56;
Base64IdxTab['5'] = 57;
Base64IdxTab['6'] = 58;
Base64IdxTab['7'] = 59;
Base64IdxTab['8'] = 60;
Base64IdxTab['9'] = 61;
Base64IdxTab['A'] = 0;
Base64IdxTab['B'] = 1;
Base64IdxTab['C'] = 2;
Base64IdxTab['D'] = 3;
Base64IdxTab['E'] = 4;
Base64IdxTab['F'] = 5;
Base64IdxTab['G'] = 6;
Base64IdxTab['H'] = 7;
Base64IdxTab['I'] = 8;
Base64IdxTab['J'] = 9;
Base64IdxTab['K'] = 10;
Base64IdxTab['L'] = 11;
Base64IdxTab['M'] = 12;
Base64IdxTab['N'] = 13;
Base64IdxTab['O'] = 14;
Base64IdxTab['P'] = 15;
Base64IdxTab['Q'] = 16;
Base64IdxTab['R'] = 17;
Base64IdxTab['S'] = 18;
Base64IdxTab['T'] = 19;
Base64IdxTab['U'] = 20;
Base64IdxTab['V'] = 21;
Base64IdxTab['W'] = 22;
Base64IdxTab['X'] = 23;
Base64IdxTab['Y'] = 24;
Base64IdxTab['Z'] = 25;
Base64IdxTab['a'] = 26;
Base64IdxTab['b'] = 27;
Base64IdxTab['c'] = 28;
Base64IdxTab['d'] = 29;
Base64IdxTab['e'] = 30;
Base64IdxTab['f'] = 31;
Base64IdxTab['g'] = 32;
Base64IdxTab['h'] = 33;
Base64IdxTab['i'] = 34;
Base64IdxTab['j'] = 35;
Base64IdxTab['k'] = 36;
Base64IdxTab['l'] = 37;
Base64IdxTab['m'] = 38;
Base64IdxTab['n'] = 39;
Base64IdxTab['o'] = 40;
Base64IdxTab['p'] = 41;
Base64IdxTab['q'] = 42;
Base64IdxTab['r'] = 43;
Base64IdxTab['s'] = 44;
Base64IdxTab['t'] = 45;
Base64IdxTab['u'] = 46;
Base64IdxTab['v'] = 47;
Base64IdxTab['w'] = 48;
Base64IdxTab['x'] = 49;
Base64IdxTab['y'] = 50;
Base64IdxTab['z'] = 51;

字符 -> 数字的解码规则,
这要跟编码规则匹配,还有另一个数组(它是存在的,虽然你没贴出来):数字->字符
2011-8-14 22:08
0
雪    币: 81
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
6
哦明白了他是和assic码表相对应的,刚对应的
2011-8-14 22:17
0
雪    币: 3247
活跃值: (3291)
能力值: ( LV4,RANK:40 )
在线值:
发帖
回帖
粉丝
7
可以调用人\微软提供的标准的 BASE64 的加密解密算法~!
2011-8-14 22:30
0
游客
登录 | 注册 方可回帖
返回
//