当前位置:网站首页>Base64 and base64url
Base64 and base64url
2022-07-03 08:12:00 【AI fish head with chopped pepper】
Base64 Code Introduction
First ,Base64 It's a way of encoding , Instead of real encryption . Even if ,Base64 It is only used as a simple “ encryption ” To protect some data , Real encryption is usually cumbersome .
Base64 Use 64 A common printable character to store and represent binary word data , At the same time, simple encryption can also be carried out , Generate unreadable text .Base64 The character set includes large 、 Small letters , Arabic numerals 0-9, as well as "+“ and ”/“, And suffixed ”=“ total 65 Characters , Among them, only the former 64 individual . How to use this 64 Characters to represent binary data ? This needs to be in decimal 0 To 63 And the use of 64 Establish a one-to-one correspondence between characters . The specific mapping is decimal 0 To 63 And, in turn, "A-Z”, “a-z”, “0-9”, “+”, "/" One-to-one correspondence . In the computer 64 One possibility only needs 6bits Can express (26=64), therefore Base64 The expression is essentially based on 6bits In units of , Use the specified general character set to represent and store binary data .
Base64 Encoding table
Code value | character | Code value | character | Code value | character | Code value | character |
---|---|---|---|---|---|---|---|
0 | A | 16 | Q | 32 | g | 48 | w |
1 | B | 17 | R | 33 | h | 49 | x |
2 | C | 18 | S | 34 | i | 50 | y |
3 | D | 19 | T | 35 | j | 51 | z |
4 | E | 20 | U | 36 | k | 52 | 0 |
5 | F | 21 | V | 37 | l | 53 | 1 |
6 | G | 22 | W | 38 | m | 54 | 2 |
7 | H | 23 | X | 39 | n | 55 | 3 |
8 | I | 24 | Y | 40 | o | 56 | 4 |
9 | J | 25 | Z | 41 | p | 57 | 5 |
10 | K | 26 | a | 42 | q | 58 | 6 |
11 | L | 27 | b | 43 | r | 59 | 7 |
12 | M | 28 | c | 44 | s | 60 | 8 |
13 | N | 29 | d | 45 | t | 61 | 9 |
14 | O | 30 | e | 46 | u | 62 | + |
15 | P | 31 | f | 47 | v | 63 | / |
Using tools http://www.lzltool.com/base64 It can be parsed online Base64, take Base64 Convert to string or hexadecimal 、 or Base64Url Format
Base64URL Code Introduction
Due to the standard Base64 Characters... May appear after encoding + and /, stay URL Can't be used as a parameter directly , So there is another kind of "url safe" Of base64 code , In fact, it is to put characters + and / Become respectively - and _
because = Characters can also appear in Base64 In the encoding , but = Use in URL、Cookie There's ambiguity in it , therefore ,Base64URL After coding, it will put = Get rid of
Get rid of = How to decode after ? because Base64 It's a 3 Bytes become 4 Bytes , therefore ,Base64 The length of the code is always 4 Multiple , therefore , Need to add = hold Base64 The length of the string becomes 4 Multiple , It can be decoded normally .
Using tools http://www.lzltool.com/base64url It can be parsed online Base64URL, take Base64URL Convert to string or hexadecimal 、 or Base64 Format
边栏推荐
- MAE
- Zohocrm deluge function application time verification
- P2622 light off problem II (state compression search)
- 一条通往服务器所有端口的隧道
- [end of 2021] National Meteorological Short Video (Kwai, Tiktok) influence list in December
- Open the influence list of "National Meteorological Short Videos (Kwai, Tiktok) in November" in an interactive way“
- Huawei switch console password reset, device initialization, default password
- Puhua PLM empowers the whole scene product lifecycle management and helps the enterprise digital transformation of the main line of products
- 方正锐利重磅升级到12.0版本,包装印前处理更加便捷、高效!
- 使用 FileChannel 进行文件的复制拷贝
猜你喜欢
I want to do large screen data visualization application feature analysis
Free use until 2015 -- viz artist multi touch plug-in package
Minimap plug-in
Unity XR realizes interaction (grasping, moving, rotating, transmitting, shooting) -pico
Lua framwrok framework starts
PostGIS space function
数据的存储
Flex flexible box layout
How to configure GDAL under idea
Xlua task list youyou
随机推荐
Golang中删除字符串的最后一个字符
Golang 时间格式整理
Iterm2 setting
oracle 插入单引号
C language - Introduction - essence Edition - take you into programming (I)
Transplantation of tslib Library
Golang json格式和结构体相互转换
P2622 light off problem II (state compression search)
Worldview satellite remote sensing image data / meter resolution remote sensing image
Youyou1 of xlua knapsack system
数据的存储
Lua hot update basic grammar
Getting started with minicom
Transfinite hacker cognition
Use filechannel to copy files
Usage of (case, when) in PostgreSQL
Microsoft Security Response Center
Quelle est la définition? Qu'est - ce qu'une déclaration? Quelle est la différence?
2020-12-12
Basic operation and process control