[UPHPU] Class and Object Storage

Walt Haas haas at xmission.com
Sun Feb 17 12:54:31 MST 2008

Justin Giboney wrote:
> Walt Haas wrote:
>> I'm trying to understand what you want to do.  From what you said I'm 
>> guessing that you want a portable way to generate unique keys for a 
>> cache, and are looking to some implementation of UUID to do this. 
>> [see http://tools.ietf.org/html/rfc4122]
> I already have that GUID/UUID part, see 
> http://www.expresslanevideo.com/docs/guid.txt (I am sure there are 
> better implementations, and I am open to suggestions.)
> The problem I am having is easy implementation for a web based system. 
Easy implementation of WHAT for a web based system?  The generation of 
the UUID? A singleton object could potentially do more harm than good, 
if that's what you are talking about.  In any case creation of the 
object is pretty light weight, so you won't take much of a performance 
hit if you re-create it for every session.  The big issue will be, what 
do you have to do to generate true randomness?  I recently wrote a bash 
random encryption key generator that uses the  RANDOM function seeded by 
the nanoseconds of the real time clock.  Without the seed, RANDOM 
generates the same sequence of numbers every time you use it.  The clock 
is obviously not truly random but for the application I was building, 
it's good enough to put the generated encryption key value out of reach 
of most attackers.  If you can't solve the randomness generation 
problem, you are at serious risk of UUID collisions.

Or are you talking about easy implementation of a cache for user data 
between hits?

Have you looked at using FastCGI-type technology?  That keeps the whole 
program persistent between requests.  But of course it has its own set 
of issues.

-- Walt

More information about the UPHPU mailing list