hash1689%python.module
fault.route

Hash path implementation for compressing file paths.

Sequence
import

Iterable
import

functools0
import

FNV
class

FNVcompute0
classmethod

compute(Class, data)

FNV__init__0
method

__init__(self)

FNVupdate0
method

update(self, data)

FNVhexdigest0
method
str

hexdigest(self)

FNVdigest150%
method
int

digest(self)

Segmentation0
class

Hash implementation container providing division logic for constructing the path segment to be used by a resource's key.

Segmentation__init__0
method

__init__(self, implementation, algorithm, depth, length)

Segmentationdivide0
staticmethod
Sequence[str]

divide(digest, length, edge, step)

Split the hex digest into parts for building a Route to the bucket.

Segmentation__call__0
method
Sequence[str]

__call__(self, key)

Hash the given key with the configured algorithm returning the divided digest.

Segmentationidentity233%
method
tuple[str, int, int]

identity(self)

Return a tuple consisting of the algorithm identifier, the number of divisions, and the character length of the hex digest.

Segmentationfrom_identity650%
classmethod

from_identity(Class)

Create an instance using the identity.

Index0
class

A bucket index for Directory resources.

Manages the sequence of entries for a bucket.

The index files are a series of entry identifiers followed by the key on a greater indentation level; the trailing newline of each indentation block not being part of the key.

Indexstructure0
staticmethod

structure(seq)

Structure the indentation blocks into (key, entry) pairs. The keys are the indented section and the entries are the leading unindented identifier.

Trailing newlines MUST be present. Structure presumes that the index file was loaded using readlines.

Entries (unindented areas) must be a single line followed by one or more indented lines. The initial indentation level (first tab) will be remove; the content will be considered to be the continuation of the key (that's hashed to select this bucket's index).

Underscore attributes are representations of stored data.

Indexfrom_path40%
classmethod

from_path(Class, path)

Index__init__0
method

__init__(self)

Indexload0
method

load(self, lines)

Load the index from the given line sequence. lines items must have trailing newlines.

Indexsequence0
method

sequence(self)

Send the serialized index state to the given write function.

Indexkeys20%
method

keys(self)

Iterator containing the keys loaded from the index.

Indexitems0
method

items(self)

Indexhas_key0
method

has_key(self, key)

Check if a key exists in the index.

Index__getitem__0
method

__getitem__(self, key)

Index__delitem__10%
method

__delitem__(self, key)

Indexallocate0
method

allocate(self, keys, filename)

Allocate a sequence of entries for the given keys.

Indexinsert0
method

insert(self, key, filename)

Insert the key into the bucket. The key must not already be present.

Indexdelete0
method

delete(self, key)

Delete the key from the index returning the entry for removal.

Directory0
class

Filesystem based hash tree.

DirectoryProperties

addressing

The address resolution method. Usually a Segmentation instance.

path

The route to the resource that contains the tree.

Directoryindex_name0
data

index_name = '.index'

Directory__init__0
method

__init__(self, addressing, directory)

Directoryitems0
method
Iterable[(bytes, object)]

items(self)

Returns an iterator to all the keys and their associated routes.

Directory_index0
method

_index(self, route)

Directoryallocate0
method
object

allocate(self, key)

Allocate a position for the given key and return its route.

If already allocated, return the reference to the resource.

Directoryavailable0
method
bool

available(self, key)

Whether the resource has not been allocated.

True when key has not been associated with a resource.

Directoryrelease0
method

release(self, key)

Release the allocated resource associated with the key and delete it from the index.