Search found 4 matches

by medick
Fri Feb 01, 2008 3:31 pm
Forum: [3.0/Olympus] Discussion
Topic: unique_id function
Replies: 21
Views: 21935

Re: unique_id function

^ There are only rand(), md5(), and substr() functions now. The result doesn't depend on time.

Also you can get hash of getallheaders() or something like this.
by medick
Fri Feb 01, 2008 3:20 pm
Forum: [3.0/Olympus] Discussion
Topic: unique_id function
Replies: 21
Views: 21935

Re: unique_id function

a) Ok let's forget about time return substr( md5( rand(). '_'. round( rand()*rand()/rand(), rand(1,4) ). '_'. rand() ), rand(0,15), 16 ); There are a lot of deffierent combinations with md5, substr, rand, round that can be implemented and it's based only on random values every time. 2) I think I sho...
by medick
Fri Feb 01, 2008 2:01 pm
Forum: [3.0/Olympus] Discussion
Topic: unique_id function
Replies: 21
Views: 21935

Re: unique_id function

a) Can you please explain for me why combination like

Code: Select all

return substr(md5(rand().'_'.microtime().'_'.rand()),rand(0,15),16)
is less secure?

b) MySQL is most popular and for big forums there is no words like "Doesn't optimize much". Just a thought.
by medick
Thu Jan 31, 2008 5:40 pm
Forum: [3.0/Olympus] Discussion
Topic: unique_id function
Replies: 21
Views: 21935

unique_id function

Why unique_id function so overdone? It requires to few SQL queries just to get random md5. Why not replace it with more simple combination that doesn't need any DB or I/O resources? Also it's possible to optimize set_config function - using one REPLACE query instead of few UPDATE and/or INSERT queri...