Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What possible characters may returned as a result from PHP's uniqid()?

Tags:

php

What possible characters may contained result from function uniqid() ? as I understood, this is only alphanumeric characters, but need confirm from you. So, this is so?

P.S. In documentation http://php.net/manual/en/function.uniqid.php I dont see info about this

like image 274
Oto Shavadze Avatar asked Nov 28 '12 20:11

Oto Shavadze


1 Answers

In the comments of the same documentation page : "As others below note, without prefix and without "added entropy", this function simply returns the UNIX timestamp with added microsecond counter as a hex number; it's more or less just microtime(), in hexit form."

So it returns only hexadecimal characters, e.g. 0-9 a-f.

Edit: As Vulcan pointed out in the comments below: $more_entropy, when true, appends a period and some 0-9 characters.

like image 123
Hypolite Petovan Avatar answered Nov 09 '22 23:11

Hypolite Petovan