File::HStore

Python and Perl extension to store files on a filesystem using a very simple hash-based storage. The one-way hash is generated from the content of the file added in the store. The store is building a simple directory structure based of the hexadecimal value of the hash itself. The structure of the store (depending on its size) is based on a variable level.

Python

A simple package to access a store.

Example

import FileHStore as FHS

# Create a store in the .hstore directory using sha256 as one-way hash algorithm
# and with a level of 3 (for deadbeef it will be de/ad/be/deadbeef)

store = FHS.FileHStore("./.hstore","sha256", 3)

id = store.add("./testfile")
print store.getpath(id)
store.remove(id)

Download

Install

python setup.py install

Perl

For more information, have a look at the CPAN File::HStore entry.

Warning

If you plan to use a hash-based storage (like File::HStore), don't forget to read the following paper and check the impact for your application : An Analysis of Compare-by-hash Please also consider the security impact in your application concerning the statement made by the NIST regarding the overall security impact of the SHA-1 vulnerability. In the use of storage and unique identifier only , the impact is somewhat very limited.