我试图为这一问题找到最佳解决办法。 在[0......N]范围内,我有一套明确的非否定性分类。 我需要能够代表本套中的每一份数字,并能够将这种str倒数改为原来的数字。 因此,这应该是双管齐下的职能。
Additional requirements are:
- String representation of a number should obfuscate original number at least to some degree. So primitive solution like f(x) = x.toString() will not work.
- String length is important: the less the better.
- If one knows the string representation of K, I would like it to be non-trivial (to some degree) to guess the string representation of K+1.
For p.1 & p.2 the obvious solution is to use something like Base64 (or whatever BaseXXX to fit all the values) notation. But can we fit into p.3 with minimal additional effort? Common sense tells me that I additionally need a bijective "String <-> String" function for BaseXXX values. Any suggestions? Or maybe there s something better than BaseXXX to use to fit all 3 requirements?