tools/cygprofile/orderfile_generator_backend.py
def _GenerateHash(file_path):
  """Calculates and returns the hash of the file at file_path."""
  sha1 = hashlib.sha1()
  with open(file_path, 'rb') as f:
    while True:
      # Read in 1mb chunks, so it doesn't all have to be loaded into memory.
      chunk = f.read(1024 * 1024)
      if not chunk:
        break
      sha1.update(chunk)
  return sha1.hexdigest()
Calculates and returns the hash of the file at file_path.
Calculates and returns the hash of the file at file_path.
Calculates and returns the hash of the file at file_path .
def _GenerateHash(file_path):
  sha1 = hashlib.sha1()
  with open(file_path, 'rb') as f:
    while True:
      chunk = f.read(1024 * 1024)
      if not chunk:
        break
      sha1.update(chunk)
  return sha1.hexdigest()
def _GenerateHash ( file_path ) : sha1 = hashlib . sha1 ( ) with open ( file_path , 'rb' ) as f : while True : chunk = f . read ( 1024 * 1024 ) if not chunk : break sha1 . update ( chunk ) return sha1 . hexdigest ( )
Calculates and returns the hash of the file at file_path.
Calculates and returns the hash of the file at file_path .
"""Calculates and returns the hash of the file at file_path.""" # Read in 1mb chunks, so it doesn't all have to be loaded into memory.
file_path