Created
October 30, 2014 16:15
-
-
Save stevenwoodson/ce23ca45caa8f38fbaf0 to your computer and use it in GitHub Desktop.
Random Unique String
This file contains 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
<?php | |
// Generates a string of random bytes of the provided number (7 in the example below) and then converts that binary to hexadecimal | |
// The hexadecimal conversion doubles the string size so the final result in the example below will be 14 characters long. | |
echo bin2hex(openssl_random_pseudo_bytes(7)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment