当前位置:网站首页>Base64 principle

Base64 principle

2022-06-13 06:34:00 Road and distance

Base64 principle

1.ASCII Comparison table
 Insert picture description here
2.Base 64 Comparison table
 Insert picture description here
3. Case study

The original is a contrast ASCII The comparison table is 97
Convert to binary
0110 0001

Because only 8 position , Can not be 6 to be divisible by , So we need to fill the vacancy ,6 and 8 The nearest common multiple of is 24, So we need to add 16 individual 0, That is to say
0110 0001 0000 0000 0000 0000

Will convert every 6 Bit for cutting And add two in front 0 Even for
00011000 00010000 00000000 00000000

00011000 8+16 = 24 Corresponding Base64 code Y
00010000 16 Corresponding Base64 code Q
There are two places to fill in the back 00000000 use = Instead of
The final result is YQ==

原网站

版权声明
本文为[Road and distance]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202270554449865.html