0

I have a very simple question, I have searched it in the internet everywhere and could not find the answer.

It is possible for Base62 encoding to generate same string output for different number inputs?

Example:

base62(num1) -> str1
base62(num2) -> str1

Is this possible?

ndogac
  • 1,185
  • 6
  • 15
  • 1
    The chance of collision is effectively 0 when you have proven 2 way encoding/decoding. Otherwise you could never reverse (decode) the encoding. – Igor Jan 10 '22 at 21:43
  • 1
    If you look the definition of Base62, you see that it is just a base62 number (with 62 specific characters to define each digits). So usually no. But there is always the problem that you get same bit of data in input and output, so some decoder may fill output with 0 bits (to byte boundary) on maybe not valid data. [Protocols should specify how to handle uniquely such cases). Note: also the contrary: you may be able to insert new line and spaces on encoded string (because of high level protocol/convenience) – Giacomo Catenazzi Jan 11 '22 at 06:33

0 Answers0