@@ -135,7 +135,7 @@ def process_tempita_pxd(fromfile, tofile):
135135# Hash db
136136#
137137def load_hashes (filename ):
138- # Return { filename : (sha1 of input, sha1 of output) }
138+ # Return { filename : (sha256 of input, sha256 of output) }
139139 if os .path .isfile (filename ):
140140 hashes = {}
141141 with open (filename , 'r' ) as f :
@@ -151,8 +151,8 @@ def save_hashes(hash_db, filename):
151151 for key , value in sorted (hash_db .items ()):
152152 f .write ("%s %s %s\n " % (key , value [0 ], value [1 ]))
153153
154- def sha1_of_file (filename ):
155- h = hashlib .sha1 ()
154+ def sha256_of_file (filename ):
155+ h = hashlib .sha256 ()
156156 with open (filename , "rb" ) as f :
157157 h .update (f .read ())
158158 return h .hexdigest ()
@@ -168,8 +168,8 @@ def normpath(path):
168168 return path
169169
170170def get_hash (frompath , topath ):
171- from_hash = sha1_of_file (frompath )
172- to_hash = sha1_of_file (topath ) if os .path .exists (topath ) else None
171+ from_hash = sha256_of_file (frompath )
172+ to_hash = sha256_of_file (topath ) if os .path .exists (topath ) else None
173173 return (from_hash , to_hash )
174174
175175def process (path , fromfile , tofile , processor_function , hash_db ):
0 commit comments