Im wondering how can I go on creating a random PHP value with similar structure as IPv6
Example: 2001:0db8:85a3:0042:1000:8a2e:0370:7334:nc21
I could use mt_rand(0000,9999).":"....... and so on
But this creates only numerical values, and its redundant. Is there a simpler way of doing it altha-numerically in say a function?
Thanks every one for feedback and information, in the end I choose to go with the following code bit
$randomString = sha1(dechex(mt_rand(0, 2147483647)));
$token = implode(':', str_split($randomString, 4));
Result:
9ec0:4709:926e:4cbf:fa87:2ac3:03da:f547:485b:6464