Page 1 of 1

unique_id() - can be faster?

Posted: Sat Jul 30, 2011 9:03 pm
by 1234homie
unique_id() need 2 queries to execute for get pseudo rand seed. I think it can be done with one query to config table but I don't know if its still secure so.. I've updated this funcation to something like this:

Code: Select all

removed ;D
My question is, It's still secure?

Re: unique_id() - can be faster?

Posted: Sat Jul 30, 2011 9:33 pm
by Oleg
On unix systems you can simply read data from /dev/random and hash it.

Re: unique_id() - can be faster?

Posted: Sat Jul 30, 2011 9:54 pm
by 1234homie
Oleg wrote:On unix systems you can simply read data from /dev/random and hash it. wÄ…tyk
Im on windows :(

EDIT I've been searching for an alternative. thanks ;]

Re: unique_id() - can be faster?

Posted: Sun Jul 31, 2011 4:10 am
by Oleg
If you are concerned with database latency you can write a stored procedure that would perform computation(s) inside mysql with a single roundtrip.

It's a little too late on a Saturday for me to be able to comment on security of your proposed solution, but it does certainly not appear to be as strong as a /dev/random read just based on the functions you are using.