不使用“+/="的 base64 编码;(加号或等于)字符? [英] base64 encoding that doesn't use "+/=" (plus or equals) characters?

查看:60
本文介绍了不使用“+/="的 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.

这篇关于不使用“+/="的 base64 编码;(加号或等于)字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆