Jump to content

[SOLVED] Why does PHP have a Uniqid Function if Microtime is truly unique?


limitphp

Recommended Posts

Can be useful, for instance, if you generate identifiers simultaneously on several hosts that might happen to generate the identifier at the same microsecond.

 

Microtime doesn't make any attempts to be unique, it simply returns the current time at a microsecond level.

Can be useful, for instance, if you generate identifiers simultaneously on several hosts that might happen to generate the identifier at the same microsecond.

 

Microtime doesn't make any attempts to be unique, it simply returns the current time at a microsecond level.

 

Yeah, I has posted this before you had replied to the other post pretty much answering the question in this post.

:)

 

Of course, I was thinking, I could just have the ID be auto_increment (1,2,3,4,5,etc)....

that insures that every entry is unique.

Then just attach some word to the value.

 

So then every value will be example:

1keyword, 2keyword, 3keyword, 4keyword, 5keyword

 

That will insure that people can't guess it....

 

Then md5 that value and store that in the cookie.

 

It would be unique and it would be very difficult for people to guess it, unless they found out my keyword.

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.