不使用“+/="的base64编码(加号或等于)字符? [英] base64 encoding that doesn't use "+/=" (plus or equals) characters?
问题描述
我需要编码一个大约 1000 个字符的字符串,可以是任何字节值 (00-FF).我不想使用 Hex,因为它不够密集.据我所知,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.
这篇关于不使用“+/="的base64编码(加号或等于)字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!