Last active
February 21, 2024 11:35
-
-
Save jrivero/1151122 to your computer and use it in GitHub Desktop.
Create uuid with specific dimensions
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
<?php | |
function uuid_pad($pad = 6) | |
{ | |
return substr(md5(uniqid(rand(), true)), $pad, $pad); | |
} | |
// example | |
echo uuid_pad(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment