base64笔记

简介: base64笔记

文章目录


1、WIKI的解释

Base64是一种基于64个可打印字符来表示二进制数据的表示方法。由于 log 2 ⁡ 64 = 6 ,所以每6个比特为一个单元,对应某个可打印字符。3个字节相当于24个比特,对应于4个Base64单元,即3个字节可由4个可打印字符来表示。在Base64中的可打印字符包括字母A-Za-z数字0-9,这样共有62个字符,此外两个可打印符号在不同的系统中而不同。一些如uuencode的其他编码方法,和之后BinHex英语BinHex的版本使用不同的64字符集来代表6个二进制数字,但是不被称为Base64。


2、太深奥了,翻译一下

一个字节 = 8 bit

base64 就是把一个人熟悉的文件(文本或者图片)转换成一段只有计算机熟悉的“乱码”。

可能有人会不信,那我们看图说话吧。

上图转成base64的结果

data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGsAAAChCAYAAADAzEHeAAAACXBIWXMAAAsTAAALEwEAmpwYAAAF+mlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMxNDUgNzkuMTYzNDk5LCAyMDE4LzA4LzEzLTE2OjQwOjIyICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1sbnM6cGhvdG9zaG9wPSJodHRwOi8vbnMuYWRvYmUuY29tL3Bob3Rvc2hvcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94Y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Ng07BPSDd63LBGwSNzdRw7HuMQhMdI+JxIee37VeYSq/Sf28HH/IEJoyxX00dSFGWaKHV+f/LOR/lu9NVY1yQc2CYe72IP/uk72/mJsv7hZRVJ6rCyReJyXQ0AkIhYFQ8WTAOH9roOL/w5oflj8pyVzxELWHLGQNUcsZM0RC1lzxELWHLGQNUcsZM0RC1lzxELWHLGQNUcsZM0RC1lzxELWHLGQNUcsZM0RC1lzxELWHLGQNUcsZM0RC1lzxELWHLGQNUcsZM0RC1lzxELWHLGQNUcsZM0RC1lzxELWHLGQNUcsZM0RC1lzxELWHLGQNUcsZM0RC1lzxELWHLGQNUcsZM0RC1lzxELWHLGQNUcsZM0RC1lzxELWHLGQNUcsZM0RC1lzxELWHLGQNUcsZM0RC1lzxELWHLGQNUcsZM0RC1lzxELWHLGQNUcsZM0RC1lzxELWHLGQNUcsZM0RC1lzxELWHLGQNUcsZM0RC1lzxELWHLGQNUcsZM0RC1lzxELWHLGQNUcsZM0RC1lzxELWHLGQNUcsZM0RC1lzxELWHLGQNUcsZM0RC1lzxELWHLGQNUcsZM0RC1lzxELWHLGQNUcsZM0RC1lzxELWHLGQNUcsZM0RC1lzxELWHLGQNUcsZM0RC1lzxELWHLGQNUcsZM0RC1lzxELWHLGQNUcsZM0RC1lzxELWHLGQNUcsZM0RC1lzxELWHLGQNUcsZM0RC1lzxP8FwlHbFthX+A0AAAAASUVORK5CYII=
  • 截图看了一下base64码的长度 15474个字节,直呼好家伙。

是不是就是把一个人类熟悉的转换成了计算机熟悉的东东。

手动狗头:还能这么理解,高手666.


3、发现了个问题

每个图片转成的base64码的开头都是data:image/png;base64,然后接“乱码”,一顿搜索发现

那么新问题又来了,什么是`Data URL scheme`呢* WIKI的解析

简单理解一下:Data URL Scheme(百度翻译结果:数据URL方案), 它是一种允许向WEB文档里插入外部小文件的一种固定协议,具有一定的使用格式。

  • 可能会理解出错哦,希望大哥海涵,发现问题欢迎评论,有错必改。

4、附沅大的解释

所谓Base64,就是说选出64个字符----小写字母a-z、大写字母A-Z、数字0-9、符号"+"、"/"(再加上作为垫字的"=",实际上是65个字符)----作为一个基本字符集。然后,其他所有符号都转换成这个字符集中的字符。(来自http://www.ruanyifeng.com/blog/2008/06/base64.html)


5、base64转换工具

Encode Data URL

aTool在线工具

Duri.me

DATAURL

相关文章
|
7月前
|
XML 存储 算法
BASE64的算法说明
【5月更文挑战第10天】BASE64的算法说明
59 3
|
7月前
|
移动开发 算法 安全
安卓逆向 -- 算法基础(Base64与HEX)
安卓逆向 -- 算法基础(Base64与HEX)
39 1
|
7月前
|
存储 算法 安全
C/C++学习 -- Base64算法
C/C++学习 -- Base64算法
70 0
|
机器学习/深度学习 算法 数据可视化
Induction base
Induction base 是一种基于归纳推理的算法或方法,通常用于解决机器学习或数据挖掘中的问题,特别是关联规则挖掘和分类问题。其基本思想是基于一些基本的规则或假设,通过反复应用于数据来推导出更复杂的规则或结论。
40 1
|
存储 数据库 索引
深入浅出理解base编码
深入浅出理解base编码
240 0
深入浅出理解base编码
|
C语言
BASE系列
BASE系列
122 0
|
运维 算法 数据挖掘
Proximity-Base Approaches|学习笔记
快速学习 Proximity-Base Approaches
Proximity-Base Approaches|学习笔记
|
JavaScript PHP
Base64初探
base64是一种编码格式。
936 0
Base64初探
|
前端开发
教程 将 BASE64 和图片互转
DataURI 允许在 HTML 文档中嵌入小文件,可以使用 img 标签或 CSS 嵌入转换后的 Base64 编码,减少 HTTP 请求,加快小图像的加载时间。 经过Base64 编码后的文件体积一般比源文件大 30% 左右。
2390 0