import hashlib


def _create_finding_id(control_id, resource_name, length=20):
  """Hash the control and resource; repeatable (tho not strictly unique).

  Needs to be repeatable such that the same control/test maps to the
  same SCC Finding over multiple runs.
  """
  input = control_id + resource_name
  hex = hashlib.sha256(input.encode('UTF-8')).hexdigest()
  result = int(hex, 16) % (10 ** length)
  return str(result)