Your text is converted to UTF-8 bytes using a TextEncoder. Each character becomes 1–4 bytes depending on the character.
All bytes are combined into one big BigInt number — treating the byte array as a huge base-256 number.
That number is repeatedly divided by 62. Each remainder maps to a character: 0–9, A–Z, a–z.
No padding characters needed! Base62 is naturally URL-safe and works well for short links, tokens, and unique IDs.