Just another Perl shrine | |
PerlMonks |
Re: Re: Safe for SQLby jk2addict (Chaplain) |
on Dec 11, 2002 at 21:00 UTC ( [id://219172]=note: print w/replies, xml ) | Need Help?? |
This brings up something I've been pondering for a while with regards to the predictability of using UUIDs. Back in early versions of MSSQL7, the newid() function would return predictable results when called consecutively. It appears that Data::UUID also does the same. Here's a quick run using create/to_string: yields
I usually use UUID to guarantee uniqueness, and sometimes in things like ecommerce, you don't want these things to be predictable in a basic effort to prevent end user guessing games. Yes, I know securiyy is much larger than that, but preventing predictable sequential keys for some things help. :-P If I know the first line above, it's pretty easy to start generating the next 4 through trial and error. Somewhere along the line, MSSQL7 SP3+ and MSSQL 2K made the output non predictable when running a series yields
So, what changed I wonder, and how can I make Data::UUID behave more like MSSQL2K when generating consecutive uuids? I tried feeding the previous uuid into the namespace/name of the new uuid during creation and it appears to work. yields Certainly less predictable. So, the question becomes: have I sacrificed any randomness or uniqueness by doing this? -=Chris
In Section
Seekers of Perl Wisdom
|
|