import base64


def get_hash(crc):
  """Gets the base64-encoded hash from a CRC32C object.

  Args:
    crc (google_crc32c.Checksum|predefined.Crc): CRC32C object from
      google-crc32c or crcmod package.

  Returns:
    A string representing the base64 encoded CRC32C hash.
  """
  return base64.b64encode(crc.digest()).decode('ascii')