MCPcopy Create free account
hub / github.com/cel-expr/cel-go / hashArg

Function hashArg

interpreter/async.go:176–194  ·  view source on GitHub ↗
(arg ref.Val)

Source from the content-addressed store, hash-verified

174}
175
176func hashArg(arg ref.Val) uint64 {
177 switch v := arg.(type) {
178 case types.String:
179 return hashMarkerString*31 + hashString(string(v))
180 case types.Bool:
181 if bool(v) {
182 return hashMarkerBool*31 + 1
183 }
184 return hashMarkerBool * 31
185 case types.Int:
186 return hashMarkerNumber*31 + numericKey(float64(v))
187 case types.Uint:
188 return hashMarkerNumber*31 + numericKey(float64(v))
189 case types.Double:
190 return hashMarkerNumber*31 + numericKey(float64(v))
191 default:
192 return hashMarkerDefault
193 }
194}
195
196// hashCall computes the composite bucket key for an async call.
197//

Callers 1

hashCallFunction · 0.85

Calls 2

hashStringFunction · 0.85
numericKeyFunction · 0.85

Tested by

no test coverage detected