code: def _hashfile(self,filename,blocksize=65536):
          
          logger.debug("Hashing file %s"%(filename))
          hasher=hashlib.sha256()
          afile=open(filename,'rb')
          buf=afile.read(blocksize)
          while len(buf) > 0:
              hasher.update(buf)
              buf = afile.read(blocksize)
          return hasher.hexdigest()
docs: Hashes the file and returns hash