
cz at gocept
Oct 18, 2006, 6:27 AM
Post #1 of 1
(4263 views)
Permalink
|
|
CVS: Products/Ape/lib/apelib/zodb3 - storage.py:1.19
|
|
Update of /cvs-repository/Products/Ape/lib/apelib/zodb3 In directory cvs.zope.org:/tmp/cvs-serv16672/lib/apelib/zodb3 Modified Files: storage.py Log Message: added comments about 64-bit hashin === Products/Ape/lib/apelib/zodb3/storage.py 1.18 => 1.19 === --- Products/Ape/lib/apelib/zodb3/storage.py:1.18 Wed Oct 18 09:01:36 2006 +++ Products/Ape/lib/apelib/zodb3/storage.py Wed Oct 18 09:27:15 2006 @@ -88,11 +88,15 @@ """Returns an 8-byte hash value. """ if v < -2L ** 32: + # This is a hash on a 64-bit machine. Treat as unsigned + # 64-bit integer v += 2L ** 64 elif v < 0: - # Treat the hash as an unsigned 32-bit integer + # This is a hash on a 32-bit machine. Treat as an unsigned + # 32-bit integer v += 2L ** 32 if v > 2L ** 32: + # This still is a hash on 64-bit machine. Compress to 32-bit. v = v / 2 ** 32 assert v >= 0 and v <= 2L ** 32 _______________________________________________ Zope-CVS maillist - Zope-CVS [at] zope http://mail.zope.org/mailman/listinfo/zope-cvs Zope CVS instructions: http://dev.zope.org/CVS
|