mò DµMc@s•dZdkZdkZdkZdkZdkZd„Zdd„Zd„Zei ƒZ ei ƒZ e eiƒdƒZd„Zd„ZdS( s¢ This file is part of the web2py Web Framework Copyrighted by Massimo Di Pierro License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html) NcCsti|ƒiƒS(s) Generate a md5 hash with the given text N(thashlibtmd5ttextt hexdigest(R((t5/home/camdpams_www/Products_Activation/gluon/utils.pytmd5_hashsRcCsFt|tƒp||ƒ}nti|ƒ}|i|ƒ|iƒS(s] Generates hash with the given text using the specified digest hashing algorithm N( t isinstancet digest_algtstrRthRtnewtupdateR(RRR ((Rthashs  cCsÄt|tƒp|Sn|iƒ}|djo tiSn…|djo tiSnm|djo tiSnU|djo tiSn=|djo ti Sn%|djo ti Sn t dƒ‚dS( s: Returns a hashlib digest algorithm from a string Rtsha1tsha224tsha256tsha384tsha512sInvalid digest algorithmN( RtvalueRtlowerRRR RRRRt ValueError(R((Rt get_digest"s"             f1000.0cCsCtidƒ}td|?d}td|?d}|||dS(Nii(trandomt randrangetatnode_idtitbt millisecondstc(RRRR((Rtrotate<scCsotiƒzSg}tdƒD]}|tt|ƒƒq~}tt i d|ddƒƒSWdti ƒXdS(Nitbytestversioni( tweb2py_uuid_lockertacquiret_[1]trangeRtchrRRRtuuidtUUIDtrelease(RRR#((Rt web2py_uuidBs  3 (t__doc__RR&RtthreadttimeRR Rt allocate_lockR!tgetnodeRtintRRR)( RRR R&R+RR!RR)RR,RR((Rt?s