Created
February 16, 2019 21:17
-
-
Save vsoch/58bc7e3abf98aa9724e11ea598281f8e to your computer and use it in GitHub Desktop.
A quick way to run a single file through a bunch of hashing algorithms, via Python's hashlib
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hashlib | |
filename = '/home/vanessa/.singularity/shub/vanessa-marshmallow-latest@8dc77d81e1775986b89f042112c5ee81.sif' | |
for algorithm in hashlib.algorithms_guaranteed: | |
hasher = getattr(hashlib, algorithm)() | |
with open(filename, "rb") as f: | |
for chunk in iter(lambda: f.read(4096), b""): | |
hasher.update(chunk) | |
try: | |
print("%s: %s" %(algorithm, hasher.hexdigest())) | |
except: | |
pass | |
''' | |
sha256: 7031d69fb424d5c92644d4b6e49c74c65b051ec201299c78ca1f61556da44e93 | |
sha3_256: 5ee52ab0a69044f8737b1a7c5d8a660775e8dab6bc0bdaf5017d6bf2edb3c704 | |
blake2s: 360442f4d40b22a9bcf3b2c8790ab1b5c9e2eb3c72138abb213d537b16cb269a | |
blake2b: 39fe1754e7906736b01e0d6c36cd7f61d294d8f8b9cf7a8f2767cba99f05ffee33194cada061e009abfb42d24f073cf78313a42e806c7ee3137534028100bd1c | |
sha3_512: 387c1ec0871b5cf3941fba9545fed51856855615b09a14e03178dcb20bcf1619a4af753becc6c538fc03440087da8a26ea0c8c75555be5b27a3afa34a0f10b15 | |
sha1: 52ce34d31fee42a2bc1a5c3ca8644761e3ed11a7 | |
sha3_224: c2fe753adcf6dbc2393ab2c980256f9160cc1da4a5393e48f390b2b3 | |
md5: 8dc77d81e1775986b89f042112c5ee81 | |
sha384: 3197164b80378464ae38dfe7439ec9549777fbbf864019e02c54df39c33b2627bbb8b2503dcb39940470519470a9a8de | |
sha512: ba4115ebce1abe9d0bacad42c5750cbaa4d4310d2a3034ed6c4b81582a932a18b37c35b96cc887a35ac0362ed8b84a3c8e2a5b09c8cc2a3207f884dc536c62e2 | |
sha3_384: db5e01768976a660a308f8829a233ed36922590769dec47a062c8e6eeaf83fd17e160b03748b4f2cc7f5f7c9f8be4676 | |
sha224: 861f4dd3927eb81461008d728befae99d130dffa6024db5ec28c9e18 | |
''' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment