是否可以用一个0-9a-zA-Z字符的序列来表示一个十六进制字符(0-9A-F)的序列,所以结果序列更小,可以解码?
Is it possible to represent a sequence of hex characters (0-9A-F) with a sequence of 0-9a-zA-Z characters, so the the result sequence is smaller and can be decoded?
例如:
$hex = '5d41402abc4b2a76b9719d911017c592';
echo $string = encode($hex); // someASCIIletters123
echo decode(string) == $hex; //true
你可以简单地调整我提出的解决方案 此处 使用函数base_convert_arbitrary
.
You can trivially adapt the solution I presented here using the function base_convert_arbitrary
.
我没有仔细阅读:) Base 16 到 base 62 仍然非常可行,如上所述.
I had not read carefully enough :) Base 16 to base 62 is still very doable, as above.
查看实际操作.
这篇关于将十六进制转换为 ascii 字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!