不使用“+/="的 base64 编码;(加号或等于)字符?
问题说明
我需要对一个大约 1000 个字符的字符串进行编码,该字符串可以是任何字节值 (00-FF).我不想使用十六进制,因为它不够密集.据我所知,base64 的问题在于它包含 /和 =,这是我在我的应用程序中无法容忍的字符.
I need to encode a string of about 1000 characters that can be any byte value (00-FF). I don't want to use Hex because it's not dense enough. the problem with base64 as I understand it is that it includes / and = which are characters I can not tolerate in my application.
有什么建议吗?
正确答案
正如 Ciaran 所说,base64 实现起来并不难——但你可能想看看现有的库,它允许你指定一组自定义的要使用的字符.我很确定那里有很多,但你没有指定你需要哪个平台.
As Ciaran says, base64 isn't terribly hard to implement - but you may want to have a look for existing libraries which allow you to specify a custom set of characters to use. I'm pretty sure there are plenty out there, but you haven't specified which platform you need this for.
基本上,您只需要可接受的 65 个 ASCII 字符 - 最好除了换行符.
Basically, you just need 65 ASCII characters which are acceptable - preferably in addition to line breaks.
这篇好文章是转载于:学新通技术网
- 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
- 本站站名: 学新通技术网
- 本文地址: /reply/detail/tanhcbhaih
-
YouTube API 不能在 iOS (iPhone/iPad) 工作,但在桌面浏览器工作正常?
it1352 07-30 -
iPhone,一张图像叠加到另一张图像上以创建要保存的新图像?(水印)
it1352 07-17 -
保持在后台运行的 iPhone 应用程序完全可操作
it1352 07-25 -
使用 iPhone 进行移动设备管理
it1352 07-23 -
在android同时打开手电筒和前置摄像头
it1352 09-28 -
检查邮件是否发送成功
it1352 07-25 -
扫描 NFC 标签时是否可以启动应用程序?
it1352 08-02 -
Android微调工具-删除当前选择
it1352 06-20 -
希伯来语的空格句子标记化错误
it1352 06-22 -
Android App 和三星 Galaxy S4 不兼容
it1352 07-20