Base X字符串编码 [英] Base X string encoding

查看:162
本文介绍了Base X字符串编码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一个将字符串(字节流)编码为任意基数/字母表的程序(如base64编码,但我可以选择字母表)。我已经看到了一些为数字进行基本X编码但不是字符串的例程。

解决方案

有我的BaseX(BaseN)编码算法的实现: https://github.com/KvanTTT/BaseNcoding 。 p>

此外,您还可以在演示站点上尝试不同的字母和参数: http://kvanttt.github.io/BaseNcoding/


I'm looking for a routine that will encode a string (stream of bytes) into an arbitrary base/alphabet (like base64 encoding but I get to choose the alphabet). I've seen a few routines that do base X encoding for a number, but not for a string.

解决方案

There is my implementation of BaseX (BaseN) encoding algorithm: https://github.com/KvanTTT/BaseNcoding.

Also you can experiment with different alphabets and parameters at demo-site: http://kvanttt.github.io/BaseNcoding/

这篇关于Base X字符串编码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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