(self, dbfile, magic=b("HSH3"), hashtype=0)
:param dbfile: a :class:`~whoosh.filedb.structfile.StructFile` object
            to write to.
        :param magic: the format tag bytes to write at the start of the file.
        :param hashtype: an integer indicating which hashing algorithm to use.
            Possible values are 0 (MD5), 1 (CRC32), or 2 (CDB hash).
:param dbfile: a :class:`~whoosh.filedb.structfile.StructFile` object
            to write to.
        :param magic: the format tag bytes to write at the start of the file.
        :param hashtype: an integer indicating which hashing algorithm to use.
            Possible values are 0 (MD5), 1 (CRC32), or 2 (CDB hash).
: param dbfile : a : class : ~whoosh . filedb . structfile . StructFile object to write to . : param magic : the format tag bytes to write at the start of the file . : param hashtype : an integer indicating which hashing algorithm to use . Possible values are 0 ( MD5 ) 1 ( CRC32 ) or 2 ( CDB hash ) .
def __init__(self, dbfile, magic=b("HSH3"), hashtype=0):
        """
        :param dbfile: a :class:`~whoosh.filedb.structfile.StructFile` object
            to write to.
        :param magic: the format tag bytes to write at the start of the file.
        :param hashtype: an integer indicating which hashing algorithm to use.
            Possible values are 0 (MD5), 1 (CRC32), or 2 (CDB hash).
        """

        self.dbfile = dbfile
        self.hashtype = hashtype
        self.hashfn = _hash_functions[self.hashtype]
        # A place for subclasses to put extra metadata
        self.extras = {}

        self.startoffset = dbfile.tell()
        # Write format tag
        dbfile.write(magic)
        # Write hash type
        dbfile.write_byte(self.hashtype)
        # Unused future expansion bits
        dbfile.write_int(0)
        dbfile.write_int(0)

        # 256 lists of hashed keys and positions
        self.buckets = [[] for _ in xrange(256)]
        # List to remember the positions of the hash tables
        self.directory = []
def __init__ ( self , dbfile , magic = b ( "HSH3" ) , hashtype = 0 ) : self . dbfile = dbfile self . hashtype = hashtype self . hashfn = _hash_functions [ self . hashtype ] # A place for subclasses to put extra metadata self . extras = { } self . startoffset = dbfile . tell ( ) # Write format tag dbfile . write ( magic ) # Write hash type dbfile . write_byte ( self . hashtype ) # Unused future expansion bits dbfile . write_int ( 0 ) dbfile . write_int ( 0 ) # 256 lists of hashed keys and positions self . buckets = [ [ ] for _ in xrange ( 256 ) ] # List to remember the positions of the hash tables self . directory = [ ]