@@ -15,6 +15,10 @@ def give_hash(file_in, with_this):
1515 with io .open (file_in , 'rb' ) as f :
1616 return with_this (f .read ()).hexdigest ()
1717
18+ def give_hashblake (file_in , with_this ):
19+ with io .open (file_in , 'rb' ) as f :
20+ return with_this (f .read (),digest_size = 32 ).hexdigest ()
21+
1822
1923if __name__ == '__main__' :
2024 if len (sys .argv ) < 2 :
@@ -37,8 +41,10 @@ def give_hash(file_in, with_this):
3741 + " " * (33 - 5 )
3842 + "| Size"
3943 + " " * (20 - 6 )
40- + " | SHA3-256"
41- + " " * (64 - 7 )
44+ #+ " | SHA3-256"
45+ #+ " " * (64 - 8)
46+ + " | blake2b-256"
47+ + " " * (64 - 11 )
4248 )
4349 line = "|" .join (
4450 ["-" * len (i ) for i in header .split ("|" )]
@@ -52,7 +58,9 @@ def give_hash(file_in, with_this):
5258 f"{ give_hash (file , hashlib .sha1 )} | " +
5359 f"{ give_hash (file , hashlib .sha256 )} | " +
5460 f"{ os .path .basename (file ):33} |" +
55- f"{ os .path .getsize (file ):13,} " .replace ("," , " " ) + ' Bytes' + f" | { give_hash (file , hashlib .sha3_256 )} " )
61+ f"{ os .path .getsize (file ):13,} " .replace ("," , " " ) + ' Bytes | ' +
62+ # f" | {give_hash(file, hashlib.sha3_256)}"
63+ f"{ give_hashblake (file , hashlib .blake2b )} " )
5664
5765
5866
0 commit comments