remove unneeded file

This commit is contained in:
Victor Hall 2022-12-30 23:04:58 -05:00
parent b5aea97408
commit 46f84fc791
1 changed files with 0 additions and 27 deletions

View File

@ -1,27 +0,0 @@
import os
import argparse
import hashlib
def hash_bins(path):
hash = hashlib.sha256()
#recursively walk through the path
for root, dirs, files in os.walk(path):
for file in files:
#check if file is a .py file
if file.endswith('.bin'):
#sha256 hash the file
with open(os.path.join(root, file), 'rb') as f:
hash.update(f.read())
#write the hash to a file
#get filename without extension
filename = os.path.splitext(file)[0]
with open(f'{filename}.sha256', 'w') as hf:
hf.write(hash.hexdigest())
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("--path", default=None, type=str, required=True, help="Path ")
hash_bins(path)