3 ms·
The 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). Th
by chrismorgan 6y ago
The 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.