MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / BuildHash

Method BuildHash

types/response_type.go:96–108  ·  view source on GitHub ↗

BuildHash computes the hash of the response.

()

Source from the content-addressed store, hash-verified

94
95// BuildHash computes the hash of the response.
96func (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.
111func (r *Response) VerifyHash() (err error) {

Callers 7

TestResponse_SignFunction · 0.95
BenchmarkSignSignatureFunction · 0.95
buildResponseFunction · 0.45
sendQueryExMethod · 0.45
QueryMethod · 0.45
QueryMethod · 0.45

Calls 1

buildHashFunction · 0.85

Tested by 5

TestResponse_SignFunction · 0.76
BenchmarkSignSignatureFunction · 0.76
buildResponseFunction · 0.36
sendQueryExMethod · 0.36