def update_hash(src_dir, hash): """Hashes an entire ModelE source directory""" src_files = sorted(list_src_files(src_dir)) for file in src_files: fname = os.path.join(src_dir, file) with open(fname) as fin: code = fin.read() # print('Hashing %s' % fname) xhash.update(code, hash)
def update_hash(self, hash): xhash.update(self.build, hash)
def update_hash(self, hash): xhash.update(self.sources, hash) xhash.update(self.components, hash) xhash.update(self.defines, hash)
def test_simple_hash(self): """Just tests that the hash algorithm runs""" hash = hashlib.md5() xhash.update({'a' : 5, 'b' : 4}, hash) xhash.update(17, hash) xhash.update(('foo', 'bar'), hash)
def pkghash(rd, src_dir): hash = hashlib.md5() xhash.update(rd, hash) srcdir.update_hash(src_dir, hash) return hash.hexdigest()
def buildhash(rd, src_dir): hash = hashlib.md5() xhash.update(rd, hash) xhash.update(src_dir, hash) # Source directory return hash.hexdigest()