[ZODB-Dev] Re: crypto hash as key for BTrees

Casey Duncan casey at zope.com
Fri Feb 20 17:35:09 EST 2004


On Fri, 20 Feb 2004 17:24:21 -0500
John Belmonte <john at neggie.net> wrote:

> While I'm in ZODB question mode-- I vaguely remember some mention on
> the list about this before, but what is the best way to use a crypto
> hash (for example, 160-bits of data) as a key for a BTree container? 
> The options seem to be:
> 
>      * OOTree with key as binary string
>      * OOTree with key as encoded string (hex, base64, etc.)

There's no reason why the string can't be binary as far as the OOBTree
is concerned. Encoding would only be necessary for application reasons
or easier interactive debugging perhaps.

>      * IOBTree with key as number (does IOBTree support large
>      integers?)

No, IOBTree keys are C ints (32 bits on most platforms). I heard a rumor
the somebody did implement an LOBTree once though, but it's not part of
the ZODB package.

-Casey




More information about the ZODB-Dev mailing list