/usr/lib64/python2.6/site-packages/mx/UID
NameSizeModeActions
mxUID/-0755rm
COPYRIGHT10300644editdlrm
LICENSE45870644editdlrm
README1420644editdlrm
UID.py45220644editdlrm
UID.pyc52730644editdlrm
UID.pyo52730644editdlrm
__init__.py3380644editdlrm
__init__.pyc5280644editdlrm
__init__.pyo5280644editdlrm
Edit: /usr/lib64/python2.6/site-packages/mx/UID/UID.pyc (5273B)
Ñò þÅVHc @s/dZddkZddkZyddkZWnej oddkZnXddklZddkTddkl Z eie d„Z eie d„Z e Zeied„Z d dd „ƒYZd dd „ƒYZd d„Zedjo6eƒZeGdGe eƒGHeeƒdpdGHndS(s@ mx.UID -- A UID datatype. Relies on mx.DateTime. Copyright (c) 1998-2000, Marc-Andre Lemburg; mailto:mal@lemburg.com Copyright (c) 2000-2008, eGenix.com Software GmbH; mailto:info@egenix.com See the documentation for further information on copyrights, or contact the author. All Rights Reserved. iÿÿÿÿN(tDateTime(t*(t __version__cCs\||ƒiƒ}||d |ƒiƒ}d|d d}||||ƒ||dƒS(sS Mangle the UID string uid using the given key string. The output has the same length as the input UID string and should make it hard to forge valid UIDs without knowledge of the key string. Note that the output string is not a valid UID string in itself, i.e. it most likely won't verify(). itffffiii(tdigest(tuidtkeytmd5totptakeytbkeytckey((s0/usr/lib64/python2.6/site-packages/mx/UID/UID.pytmanglescCst||ƒiƒ}||d |ƒ}d|d d}||||ƒ|ƒiƒ}|||||dƒ|ƒS(sO Demangle a mangle()d UID string muid using the given key string. iRiii(R(tmuidRRRR ttuidR R ((s0/usr/lib64/python2.6/site-packages/mx/UID/UID.pytdemangle2s cCs|||ƒƒS(sW Returns the timestamp encoded in the UID string uid as DateTime instance. ((RtDateTimeFromTickst timestamp((s0/usr/lib64/python2.6/site-packages/mx/UID/UID.pyRFstIDcBsheZdZdZdddd„Zeied„Zde d„Z d„Z e d„Z ed„ZRS( sj ID class for creating unique IDs. The generated IDs are unique to the host, process and time with high probabilty. In addition their validity can be verified (using a CRC type algorithm). The algorithm uses a 40-bit timestamp in the ID which can be extracted using the .timestamp() method. Accuracy is one second. tcCs6|ot|||ƒ|_nt||ƒ|_dS(s Construct a new uid for the object target. target defaults to the singleton None. code is an optional addition to the uid that can later be used to verify the validity of the uid together with the UID's CRC value. timestamp may be given as DateTime instance. It defaults to the current local time. N(tUIDR(tselfttargettcodeR((s0/usr/lib64/python2.6/site-packages/mx/UID/UID.pyt__init__escCs|||iƒƒS(sS Returns the timestamp encoded in the ID as DateTime instance. (R(RRR((s0/usr/lib64/python2.6/site-packages/mx/UID/UID.pyRxscCs*|||ƒp td‚n||_dS(Ns invalid UID(tErrorR(RRRtverify((s0/usr/lib64/python2.6/site-packages/mx/UID/UID.pytset_uid‚s cCs|iS(N(R(R((s0/usr/lib64/python2.6/site-packages/mx/UID/UID.pyt__str__ŒscCs||i|iƒS(N(R(Rtothertcmp((s0/usr/lib64/python2.6/site-packages/mx/UID/UID.pyt__cmp__scCs ||iƒS(N(R(Rthash((s0/usr/lib64/python2.6/site-packages/mx/UID/UID.pyt__hash__–sN(t__name__t __module__t__doc__tNoneRRRRRRRRRRR R!(((s0/usr/lib64/python2.6/site-packages/mx/UID/UID.pyRVs     t _EmptyClasscBseZRS((R"R#(((s0/usr/lib64/python2.6/site-packages/mx/UID/UID.pyR&sRcCs&tƒ}t|_|i||ƒ|S(sÁ Create an ID object from the given string UID. This can raise an Error in case the string does not map to a valid UID. code is used in the verification process if given. (R&Rt __class__R(tsRtid((s0/usr/lib64/python2.6/site-packages/mx/UID/UID.pyt IDFromUID¢s  t__main__s timestamp =tOKsNOT OK(((R$tstringt mimetypesthashlibt ImportErrorRtmxRtmxUIDRRR RRttimestamp_ticksRRR&R*R"RRR(((s0/usr/lib64/python2.6/site-packages/mx/UID/UID.pyt s(  G