def sha256(filename, onlyname): f = open(filename, 'rb') sh = hashlib.sha256() sh.update(f.read()) print (sh.hexdigest(),"*",onlyname ) f.close() return
path = sys.path[0] print(path) list1=os.listdir(path) for i in range(0,len(list1)): if (os.path.isfile(path +'\\'+ list1[i]) == True ): sha256(path +'\\'+ list1[i], list1[i])