Atom

Cryptographic hashing

Save as checksum.atom and run atom run checksum.atom -- input.bin. Requires OpenSSL and filesystem support. It hashes the complete file.

checksum.atom
use binary
use crypto
use os

assert(count(os.args) == 1, 'usage: checksum FILE')
file = os.args[0]
digest = crypto.hash('sha256', read(file, 'rb'))
print(binary.hex(digest), file)