Is there some algorithm that can transform any string input (of any length) into a shortest possible coherent/unique numeric identifiant.
By "coherent", I mean that the same input will always give the same output consistently. Similar to a hash function.
By "unique", I mean that the generated value will not be generated for a different input, in other terms : there is no collision in the output domain.
By "shortest", I mean that the output length should be proportional to the input length, and with a minimal factor. Let's say, one answer produce a length that is, on average 5 times the length of the input, and another answer produce a length that is 3 times the length of the input => I will pick the second one.
The output should only contains digits and can be any length (shortest possible).
A cryptographic hash (like sha256) will respond to the problem, but maybe not in the most satisfaying manner, because of the produced length.