Created
January 12, 2016 15:15
-
-
Save dryliketoast/5c51d48da1b0d5662476 to your computer and use it in GitHub Desktop.
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
Base 36 to Integer: | |
intval($str,36) | |
Integer to Base 36: | |
base_convert($val, 10, 36) | |
So then, instead of redirecting to a route like /url/1234 it becomes /url/ax instead. | |
This gives you a whole lot more use than a hash will, as there will be no collisions. | |
Don't hash, use other bases for this kind of thing. (It's faster and can be made collision-proof.) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment