BuildHash computes the hash of the response.
()
| 94 | |
| 95 | // BuildHash computes the hash of the response. |
| 96 | func (r *Response) BuildHash() (err error) { |
| 97 | // set rows count |
| 98 | r.Header.RowCount = uint64(len(r.Payload.Rows)) |
| 99 | |
| 100 | // build hash in header |
| 101 | if err = buildHash(&r.Payload, &r.Header.PayloadHash); err != nil { |
| 102 | err = errors.Wrap(err, "compute response payload hash failed") |
| 103 | return |
| 104 | } |
| 105 | |
| 106 | // compute header hash |
| 107 | return r.Header.BuildHash() |
| 108 | } |
| 109 | |
| 110 | // VerifyHash verify the hash of the response. |
| 111 | func (r *Response) VerifyHash() (err error) { |