Functions | |
| def | block_hashes_for_file |
| def | block_hashes_from_file |
| def | block_hashes_to_file |
| def | hash_to_dir |
| def | blocks_for_file |
| def | blocks_to_file |
| def | filter_existing_block_hashes |
| def | walk |
| def | statistics |
| def | verify |
Block-level deplucation utility functions.
| def damn_at.bld.block_hashes_for_file | ( | an_uri | ) |
Calculate the hash for each block in the given file as well as the hash for the entire file and return it. :param an_uri: the URI pointing to the file :rtype: string, list<string>

| def damn_at.bld.block_hashes_from_file | ( | an_uri | ) |
Deserialize the saved block hashes from the given file. :param an_uri: the URI pointing to the file :rtype: list<string>

| def damn_at.bld.block_hashes_to_file | ( | file_hash, | |
| block_hashes, | |||
| an_uri | |||
| ) |
Serialize the given block hashes to the given uri destination. :param file_hash: the complete file's hash :param block_hashes: a list of block hashes to serialize :param an_uri: the file path which to save to :rtype: list<string>

| def damn_at.bld.blocks_for_file | ( | an_uri, | |
| destination | |||
| ) |
Write all blocks for the given file to the destination. :param an_uri: the URI pointing to the file to split :param destination: the destination directory for the block files :rtype: list<string> the paths to the written blocks


| def damn_at.bld.blocks_to_file | ( | an_uri, | |
| block_hashes, | |||
| destination | |||
| ) |
Combine the referenced blocks into a given destination file. :param an_uri: the directory containing the blocks :param block_hashes: a list of block hashes :param destination: the destination file path


| def damn_at.bld.filter_existing_block_hashes | ( | an_uri, | |
| block_hashes | |||
| ) |
Check the given uri if it contains the given blocks and filter out the existing. :param an_uri: the directory containing the blocks :param block_hashes: the list of block hashes to check for existence :rtype: list<string> a list of block hashes that do not exist

| def damn_at.bld.hash_to_dir | ( | hash | ) |
Transforms a given hash to a relative path and filename
ex: '002badb952000339cdcf1b61a3205b221766bf49' ->
'00/2badb952000339cdcf1b61a3205b221766bf49'
:param hash: the hash to split
:rtype: string

| list damn_at.bld.block_hashes |
| tuple damn_at.bld.test_files_dir |
1.8.6