Package: hashfile
hashfilecalculates hashes or checksums in many formats, also verify
them.Default algorithm issha1. This can be changed by passing argument-a/--algorithmtohashfile, or by callinghashfilewith
algorithm name (ie. using symlinks).hashfileworks pretty well with big files, because always read data
partially, by default 4MB of data at once (it can be changed using--max-input-readparam).Examples# simplest call
% hashfile /etc/hosts
sha1: 4f53fb6efebddfdbe989f3bff980cd07ebcdc6bb /etc/hosts

# specify algorithm
% hashfile -a md5 /etc/hosts
md5: 71e875e9d194c18567f48cf9534ed6cf /etc/hosts

# one file, many algorithms
% hashfile -a md5 -a sha1 /etc/hosts /etc/hosts
md5: 71e875e9d194c18567f48cf9534ed6cf /etc/hosts
sha1: 4f53fb6efebddfdbe989f3bff980cd07ebcdc6bb /etc/hosts

# many files, other algorithm for each one
% hashfile -a md5 -a sha1 /etc/hosts /etc/shells
md5: 71e875e9d194c18567f48cf9534ed6cf /etc/hosts
sha1: e0de09cb8797a4d39f89049d74585e815a3c6ceb /etc/shells

# many files, one algorithm
% hashfile -a sha256 /etc/hosts /etc/shells
sha256: 48127a192d62fdcaa39f7cebd1ea5f3fe660807c8cd3a92599406d16bddc341a /etc/hosts
sha256: edfd1953cce18ab14449b657fcc01ece6a43a7075bab7b451f3186b885c20998 /etc/shells

# choose algorithm using symlinks
% ln -s `which hashfile` ~/bin/sha256
% sha256 /etc/hosts
sha256: 48127a192d62fdcaa39f7cebd1ea5f3fe660807c8cd3a92599406d16bddc341a /etc/hosts

# create verify file, and then verify
% hashfile -a sha256 README.* > check.sum
% hashfile -c check.sum
README.md: OK
README.rst: OKCurrent stable version2.1.5Python versionhashfileworks with Python 2.7+ and 3.3+.UsageEverything is in help :) Just execute:hashfile --helpLook at result (remember: list of algorithms may vary on your system):% hashfile --help
usage: hashfile [-h]
                [--algorithm {adler32,crc32,md4,md5,mdc2,ripemd160,sha,sha1,sha224,sha256,sha384,sha512,whirlpool}]
                [--generate-algo-symlinks] [--check] [--quiet] [--status]
                [--warn] [--max-input-read MAX_INPUT_READ]
                [FILE [FILE ...]]

Calculate hash of some files

positional arguments:
  FILE                  list of files (stdin by default)

optional arguments:
  -h, --help            show this help message and exit
  --algorithm {adler32,crc32,md4,md5,mdc2,ripemd160,sha,sha1,sha224,sha256,sha384,sha512,whirlpool}, -a {adler32,crc32,md4,md5,mdc2,ripemd160,sha,sha1,sha224,sha256,sha384,sha512,whirlpool}
                        algorithm used to calculate hash If given more then
                        one, then use different algorithms for different files
                        (use first algo to first file, second algo to second
                        file etc. If there is more files then algorithms, last
                        algorithm from list is used.
  --generate-algo-symlinks
                        Show aliases for every algorithm handled by hashfile
  --check, -c           read checksums from the FILEs and check them
  --quiet, -q           don't print OK for each successfully verified file
  --status, -s          don't output anything, status code shows success
  --warn, -w            warn about improperly formatted checksum lines
  --max-input-read MAX_INPUT_READ
                        maximum data size for read at once

Algorithm can be also set from program name (for example call program as sha1
to use sha1 algorithm)InstallationUsing PIPhashfileshould work on any platform wherePythonis available, it means Linux, Windows,
MacOS X etc.Simplest way is to use Python’s built-in package system:pip install hashfileUsingpipsipipsi install hashfileUsing sourcesDownload sources fromGithub:wget -O 2.1.5.zip https://github.com/msztolcman/hashfile/archive/2.1.5.ziporcurl -o 2.1.5.zip https://github.com/msztolcman/hashfile/archive/2.1.5.zipUnpack:unzip 2.1.5.zipAnd installcd hashfile-2.1.5
python setup.py installVoila!AuthorsMarcin Sztolcmanmarcin@urzenia.netContactIf you like or dislike this software, please do not hesitate to tell me
about this me via email (marcin@urzenia.net).If you find bug or have an idea to enhance this tool, please use
GitHub’sissues.LicenseThe MIT License (MIT)Copyright (c) 2012 Marcin SztolcmanPermission 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.ChangeLogv2.1.5fixed reading binary data from stdinv2.1.4fixed working with binary fileshashfile is now a packagesome package-related changesfew updates to Makefilev2.1.3fixed working with aliasesv2.1.2another small improvements for PyPIforgotten changelogv2.1.1small improvements for setup.py and PyPIv2.1.0added –version switchv2.0.0added compatibility with tools like md5sum or sha1sum (verify mode,
call arguments compatibility, etc)v1.0.0First public version