'Store a hash for a PDU
Args:
txn (cursor):
events (list): list of Events.'

def _store_event_reference_hashes_txn(self, txn, events):

    vals = []
    for event in events:
        (ref_alg, ref_hash_bytes) = compute_event_reference_hash(event)
        vals.append({'event_id': event.event_id, 'algorithm': ref_alg, 'hash': buffer(ref_hash_bytes)})
    self._simple_insert_many_txn(txn, table='event_reference_hashes', values=vals)
