Menu

Tree [bc4409] default tip /
 History

Read Only access


File Date Author Commit
 filehash 2015-11-29 Petr Gladkiy Petr Gladkiy [3519dd] Add SHA512 support
 test 2015-11-29 Petr Gladkiy Petr Gladkiy [3519dd] Add SHA512 support
 .hgignore 2015-11-29 Petr Gladkiy Petr Gladkiy [bc4409] Update readme and .hgignore
 README.rst 2015-11-29 Petr Gladkiy Petr Gladkiy [bc4409] Update readme and .hgignore
 setup.py 2015-11-29 Petr Gladkiy Petr Gladkiy [3519dd] Add SHA512 support

Read Me

FILEHASH

Filehash module provides API to work with hashsum files from command line and python code.

The main goals:

  • provide CLI utilites alike md5sum when POSIX utils is not an option;
  • ad-hoc script to store and update hashes for files in whole directory.

Installation

Requirements:

  • Python 3.3+;
  • setuptools package.

Usage

Package provides next command line scripts:

  • chksum - check hashfiles produced by various functions;
  • md5sum - generate hashsums using the MD5 algorithm;
  • sha1sum - generate hashsums using the SHA-1 algorithm;
  • sha256sum - generate hashsums using the SHA-256 algorithm;
  • sha512sum - generate hashsums using the SHA-512 algorithm;
  • dirhash - utility to create and update hashes of directory contents.

Dirhash is used to manage hashfile which is intended to hold hashes for directory contents including sub-directories. The file is named by the basename of directory itself with '.md5' extension (e.g. directory hashfile in /foo/bar would be named bar.md5).

Utility adds to the hashfile all the files in current directory and it's descendants. Sub-dirctory hashfiles are ignored. If one of already hashed files is changed or deleted, then it must be explicitly passed to the utility as argument. Otherwise directory hashfile would not be updated; instead it prints names of the "broken" files.

CLI option -m allows to remove all missed files from directory hashfile.

CLI option -l makes script to update hashfile of leaf subdirectories. This is intended to create initial hashfiles in leaf subdirectories of whole directory tree.

Development

To run tests the py.test package is required.

License

Copyright (c) 2013, Petr Gladkiy

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.