code: func validatePvtdata(tx *internal.Transaction, pvtdata *ledger.TxPvtData) error {
  	if pvtdata.WriteSet == nil {
  		return nil
  	}
  
  	for _, nsPvtdata := range pvtdata.WriteSet.NsPvtRwset {
  		for _, collPvtdata := range nsPvtdata.CollectionPvtRwset {
  			collPvtdataHash := util.ComputeHash(collPvtdata.Rwset)
  			hashInPubdata := tx.RetrieveHash(nsPvtdata.Namespace, collPvtdata.CollectionName)
  			if !bytes.Equal(collPvtdataHash, hashInPubdata) {
  				return &validator.ErrPvtdataHashMissmatch{
  					Msg: fmt.Sprintf(`Hash of pvt data for collection [%s:%s] does not match with the corresponding hash in the public data.
  					public hash = [%#v], pvt data hash = [%#v]`, nsPvtdata.Namespace, collPvtdata.CollectionName, hashInPubdata, collPvtdataHash),
  				}
  			}
  		}
  	}
  	return nil
  }
docs: // validPvtdata returns true if hashes of all the collections writeset present in the pvt data
  // match with the corresponding hashes present in the public read-write set