def digest(array):
    objId = getReferenceId(array)

    record = None
    if objId in dataArrayShaMapping:
        record = dataArrayShaMapping[objId]

    if record and record['mtime'] == array.GetMTime():
        return record['sha']

    record = {'sha': hashDataArray(array), 'mtime': array.GetMTime()}

    dataArrayShaMapping[objId] = record
    return record['sha']
Example #2
0
def digest(array):
  objId = getReferenceId(array)

  record = None
  if objId in dataArrayShaMapping:
    record = dataArrayShaMapping[objId]

  if record and record['mtime'] == array.GetMTime():
    return record['sha']

  record = {
    'sha': hashDataArray(array),
    'mtime': array.GetMTime()
  }

  dataArrayShaMapping[objId] = record
  return record['sha']