3 ms·
And this is why YouTube uses 11 characters in base 64, not 8. This creates a space of ~7.38E19 possible IDs.
by thamer 6y ago
And this is why YouTube uses 11 characters in base 64, not 8. This creates a space of ~7.38E19 possible IDs.
- chrismorgan 6y agoThe keys are the same length. pg-shortkey is encoding 8 bytes (64 bits) as base64, which means 11 characters (at 6 bits per character; two bits are wasted). The trouble is that it’s generating random IDs, so you hit the birthday problem. If you went for sequential IDs instead (whether directly, from AAAAAAAAAAA to ___________; or permuted so that sequential numbers yield visually-random outputs), then yeah, 11 base64 characters nets you 2⁶⁶ possible IDs. Even 8 base64 characters would be ample for almost every purpose, 2⁴⁸ being around 281 trillion.