base64 根本不需要什么打开什么网站来生成啊

2020-12-08 11:37:03 +08:00
 szq8014

这东西本不值得发一个帖子……主要是看到帖子有人又制作了在线 base64 编码 /解码的网站,也见过有人专门自己写了个 python 脚本来处理的……

其实 chromium 内核的浏览器都自带了这个功能。。使用方式就是在做任意一个页面上打开 DevTools

base64 编码

btoa('hello,world')

// "aGVsbG8sd29ybGQ="

base64 解码

atob('aGVsbG8sd29ybGQ=')

// "hello,world"

配个图

顺便说一下平时怎么弄 md5 摘要

楼主是 windows 用户,安装了 git 客户端,里面集成了 md5sum 功能。

echo 123 | md5sum

# ba1f2511fc30423bdbb183fe33f3dd0f

配个图

说完了,继续潜水了

11379 次点击
所在节点    程序员
94 条回复
Osk
2020-12-08 14:02:33 +08:00
Windows 可以用 certutil 和 Pwershell: get-filehash -alg md5|sha1|sha256... file
yaphets666
2020-12-08 14:11:11 +08:00
@orzfly 这个文章好像有点问题? 好像不需要 escape 和 unescape 呀 btoa(encodeURIComponent("汉字")) decodeURIComponent(atob(base64)) 就行了
SmallTeddy
2020-12-08 14:17:03 +08:00
@iptables 我用 echo 编码可以实现 但是解码会提示我 bash: base: command not found
szq8014
2020-12-08 14:25:41 +08:00
@yaphets666 #42 你这样出来的 base64 其它方法解的话结果不正确;你可以对比其它工具看看
Lemeng
2020-12-08 14:27:44 +08:00
进来学习学习的
ThirdFlame
2020-12-08 14:30:52 +08:00
echo 要加上-n ,否则会在字符串后边加上\n
sherlockwhite
2020-12-08 14:32:08 +08:00
我用的是 Chrome 插件
newtype0092
2020-12-08 14:32:42 +08:00
@iptables shell 里 echo 有个坑
echo "hello,world" | base64
结果是 aGVsbG8sd29ybGQK,和实际结果 aGVsbG8sd29ybGQ= 不一致
仔细看了下发现原来是 echo 结果默认带换行,改成 printf "hello,world" | base64 正常了
tadebao
2020-12-08 14:37:55 +08:00
laptop:~$ echo hello,word |base64
aGVsbG8sd29yZAo=
aptop:~$ echo aGVsbG8sd29yZAo=|base64 -d
hello,word
sasalemma
2020-12-08 15:19:29 +08:00
呃 (⊙﹏⊙)

windows 用户有没有 git,都自带 powershell 的。只要是 8.1 以上的系统。就是 powershell 4.x ?以上。

直接用 get-filehash -algorithm sha1/sha256/md5 都行吧
wangxiaoaer
2020-12-08 15:36:43 +08:00
@echowuhao #3 说真的,就 MD 那个列表的鸟样,文档如果层级多点,作者不头晕吗? 再加上如果用了无序列表,读者不眼花吗?
webshe11
2020-12-08 15:42:28 +08:00
推荐一个开源的在线小工具集,可以下下来离线使用,或者放到自己服务器上
https://github.com/gchq/CyberChef
nidaye999
2020-12-08 15:43:35 +08:00
浏览器自带的 btoa 和 atob 有缺陷,比如 btoa('你好') , 否则为什么还有 js-base64 。 第三方库存在肯定是有它的道理,而且 base64 还要兼容 URL 编码。
20200924
2020-12-08 16:43:56 +08:00
学到了
TypeError
2020-12-08 16:45:09 +08:00
@echowuhao Android tasker/termux
julyclyde
2020-12-08 16:52:19 +08:00
md5sum 是 git 里带的?我还以为是系统自带的……
ttys001
2020-12-08 16:52:46 +08:00
Mac 有个叫 Boop 的 App 很好用。
hatebugs
2020-12-08 17:34:29 +08:00
base64 <<< 'hello'
base64 -d <<<'aGVsbG8K'
hatebugs
2020-12-08 17:36:26 +08:00
@julyclyde md5sum 不是 gnu 里的 coreutils 吗 咋是 git 带的
qwerthhusn
2020-12-08 17:37:08 +08:00
黑猫白猫

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/733239

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX