如何压缩字母数字字符串? [英] How to compress alphanumeric strings?

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

问题描述

我想缩小像-1234B56789C;ABC1D3E/FGH4IJKL这样的字符串,它们大约是20-25个不区分大小写的字符.

I want to shrink Strings like -1234B56789C;ABC1D3E/FGH4IJKL which are approx 20 - 25 case-insensitive chars.

我的目标是拥有一个最多不超过16个字符的字母数字字符串.它们必须保持人类可读性.

My goal is to have an alphanumeric string that is a maximum of 16 characters. They must remain human readable.

有可能吗?是否有可用于压缩还具有某些特殊字符的字母数字字符串的算法?

Is that possible? Are there algorithms that can be used to compress alphanumeric string that also has some special chars?

还必须恢复压缩.

推荐答案

我认为,除非您使用其他目标字母,否则通常是不可能的.
据我了解,目前您的source alphabet是0-9和A-Z.
如果您将target alphabet扩展为还包括某些N> 0个其他字符,
那么您可以使用较少的字符对输入字符串进行编码,
(例如,因为您可以使用
目标字母中的一个字符).

I think in general it's not possible unless you use a different target alphabet.
As far as I understand currently your source alphabet is 0-9 and A-Z.
If you extend your target alphabet to include also certain N>0 other chars,
then you can encode an input string with less characters that it originally had
(because e.g. you can encode couples of chars from the source alphabet with
a single char from the target alphabet).

这篇关于如何压缩字母数字字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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