开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜