unique_id() - can be faster?

Discussion forum for MOD Writers regarding MOD Development.
Locked
User avatar
1234homie
Registered User
Posts: 439
Joined: Fri Sep 26, 2008 3:17 pm

unique_id() - can be faster?

Post 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?
Last edited by 1234homie on Mon Aug 01, 2011 11:39 pm, edited 1 time in total.
Oleg
Former Team Member
Posts: 1221
Joined: Sat Jan 30, 2010 4:42 pm
Location: NYC
Contact:

Re: unique_id() - can be faster?

Post by Oleg »

On unix systems you can simply read data from /dev/random and hash it.
Participate in phpBB development: Get involved | Issue tracker | Report a bug | Development board | [url=irc://chat.freenode.net/phpbb-dev]Development IRC chat[/url]
My stuff: mindlinkgame.com
User avatar
1234homie
Registered User
Posts: 439
Joined: Fri Sep 26, 2008 3:17 pm

Re: unique_id() - can be faster?

Post 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 ;]
Last edited by 1234homie on Sat Aug 13, 2011 7:02 pm, edited 1 time in total.
Oleg
Former Team Member
Posts: 1221
Joined: Sat Jan 30, 2010 4:42 pm
Location: NYC
Contact:

Re: unique_id() - can be faster?

Post 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.
Participate in phpBB development: Get involved | Issue tracker | Report a bug | Development board | [url=irc://chat.freenode.net/phpbb-dev]Development IRC chat[/url]
My stuff: mindlinkgame.com
Locked

Return to “[3.0.x] MOD Writers Discussion”