#!/bin/sh # # Compare various checksum algorithms for speed. set -e algo() { printf "%6s: " "$1" python -m timeit \ -c \ -s 'import hashlib' \ -s 'data = file("test-plugins/test.cr2").read()' \ "hashlib.new('$1', string=data)" } algo md5 algo sha1 algo sha224 algo sha256 algo sha384 algo sha512