易游网-易游模拟器

 找回密码
 立即注册
查看: 2123|回复: 0

[js/html/css] typescript base64编解码实现

[复制链接]

1406

主题

1663

帖子

1万

积分

管理员

夏墨独周

Rank: 9Rank: 9Rank: 9

积分
10094

论坛元老技术达人

QQ
发表于 2021-4-21 20:31:06 | 显示全部楼层 |阅读模式

  1. encoded = Buffer.from('testbase64').toString('base64')
  2. decoded = Buffer.from(encoded, 'base64').toString()
  3. console.log(encoded)
  4. console.log(decoded)


  5. encoded = Buffer.from('测试base64').toString('base64')
  6. decoded = Buffer.from(encoded, 'base64').toString()
  7. console.log(encoded)
  8. console.log(decoded)
复制代码


来源:易游模拟器(QQ:207621422),转载请注明出处!
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|易游网-易游模拟器 Copyright @2015-2021 ( 浙ICP备15028007号-1 )

GMT+8, 2024-4-28 23:56 , Processed in 0.028322 second(s), 8 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表