Created
March 11, 2017 16:19
-
-
Save johnabela/7c13c606f8bcfd480c5b53be512182f4 to your computer and use it in GitHub Desktop.
Visual insight into a basic a-z0-9 'power of' string lengths.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If you use your own (U)(G)UID generator for unique identifiers, say UserGUID or WidgetGUID or whatnot, there is very little chance you are ever going to need to use something like `md5(time())` or `bin2hex(random_bytes(5))` or whatever. | |
Using just a very basic (and all lowercase) `a-z` & `0-9` combination will result in a 36 character string. | |
abcdefghijklmnopqrstuvwxyz0123456789 = 36 characters | |
If we take those 36 characters to the `power of` we get the follow possible unique vales: | |
[1] = 36 | |
[2] = 1,296 | |
[3] = 46,656 | |
[4] = 1,679,616 | |
[5] = 60,466,176 | |
[6] = 2,176,782,336 | |
[7] = 78,364,164,096 | |
[8] = 2,821,109,907,456 | |
[9] = 101,559,956,668,416 | |
[10] = 3,656,158,440,062,976 | |
The average developer is likely to never reach the billion+ widgets/rows so you should safely be able to go with a five (5) character GUID, at the 60-million unique level. If you are one of those few, by all means, check out the list to see just how high these numbers go, without ever introducing capital characters or a single special character. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment