MCPcopy
hub / github.com/dgraph-io/dgraph / hashMatches

Function hashMatches

edgraph/graphql.go:148–156  ·  view source on GitHub ↗
(query, sha256Hash string)

Source from the content-addressed store, hash-verified

146}
147
148func hashMatches(query, sha256Hash string) (bool, error) {
149 hasher := sha256.New()
150 _, err := hasher.Write([]byte(query))
151 if err != nil {
152 return false, err
153 }
154 hashGenerated := hex.EncodeToString(hasher.Sum(nil))
155 return hashGenerated == sha256Hash, nil
156}

Callers 1

ProcessPersistedQueryFunction · 0.85

Calls 1

WriteMethod · 0.65

Tested by

no test coverage detected