将Base64转换为Base36并返回 [英] Convert Base64 to Base36 and Back

查看:314
本文介绍了将Base64转换为Base36并返回的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



有没有人有从base 64转换为base 36再转换的代码?

基本的64个字符集为0123456789ABCDEF
基本的36个字符集是0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ

这是必需的,因为我无法表示要尝试在房间中显示的数据,因此必须对其进行加密显示,但是可读性强,并且在base 64上使用base 36可以大大减少数据的长度.数据.

Hi,

Does anyone have code for converting from base 64 to base 36 and back?

base 64 character set is 0123456789ABCDEF
base 36 character set is 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ

This is needed as I can''t represent the data I''m trying to display in the room I have to display it, it has to be displayed encrypted, but readable and using base 36 over base 64 dramatically reduces the length of the data.

推荐答案

Base 64不限于十六进制数字-它包括大小写的AZ 0-9和(通常)"+"和"'/''
基数64是基数36的超集,基数仅包括大写字母A-Z 0-9

我认为您对十六进制和base 64感到困惑.请检查您的实现.

使用Base 36表示Base 64不会减少数据的长度"-会增加数据的长度,因为许多Base 64字符在Base 36中需要两个字符空间
Base 64 is not restricted to the hex digits - it includes upper and lower case A-Z 0-9 and (normally) ''+'' and ''/''
Base 64 is a superset of base 36, which includes only upper case A-Z 0-9

I think you are confused between Hexadecimal and base 64. Check your implementation.

Using Base 36 to represent Base 64 will not "reduce the length of the data" - if anything it will increase it, because many Base 64 characters will require two character spaces in Base 36


这篇关于将Base64转换为Base36并返回的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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