PHP base_convert?
Will the outp开发者_StackOverflow社区ut prododuced by the following function always be unique?
base_convert(uniqid(), 10, 36);
Thanks.
Uniqid is not guaranteeed to be unique. If you are running your script on multiple servers they may run the call at the exact same microsecond and give the same result. This is very unlikely however.
Moreover, uniqid does not return a base-10 number so your code will definitely NOT give a unique result.
not as random as you want to. if you are on linux, better read from /dev/random
精彩评论