title: Javascript generate unique short code from an existing unique code
body: <p>Given that I already have a guaranteed unique string, is it possible to generate a shorter version of this string while keeping the newly generated strings also unique?</p>
  <p>The existing unique code is the id generated by firebase firestore, the ID is too long and I prefer not to use it as referral code. I was hoping to limit the length of the string around 8-10 chars.</p>
  <p>EX of firebase id: <code>NIzTFZUC64Voc4ttiiNsBF0GNWF3</code></p>
  <p>I need a much shorter version of this string</p>
  <p>I also don't want the codes to be case sensitive</p>