import hashlib


def get_sha1(filepath):
  """
  calculate the sha1 hash of the content of a given file

  Parameters
  ----------
  filepath : path
      the file of which to calculate the hash.

  Returns
  -------
  hash: str
      the hash of the content of the file.

  """
  sha1sum = hashlib.sha1()
  with open(filepath, 'rb') as source:
    block = source.read(2**16)
    while len(block) != 0:
      sha1sum.update(block)
      block = source.read(2**16)
  return sha1sum.hexdigest()