Is it possible to encode user’s ID# to text value?
For example if the user ID# is ‘50624’ is it possible to convert it to 7 characters text value, something like ‘DEGXCVG’?
If I use MD5 for this function I get 16-byte hash value.
The result value should not be longer than 7 or 8 characters.
Edit:
I want that each user has a different text code obtained from the id number.
If a hash function such as MD5 can be used instead of encryption, you could try
crc32()instead, which produces shorter (but with much higher chances of collisions) strings.If you just care about encoding, you could do something simpler:
Example:
Encryption version: