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

Function unhex

parser/unescape.go:222–233  ·  view source on GitHub ↗
(b byte)

Source from the content-addressed store, hash-verified

220}
221
222func unhex(b byte) (rune, bool) {
223 c := rune(b)
224 switch {
225 case '0' <= c && c <= '9':
226 return c - '0', true
227 case 'a' <= c && c <= 'f':
228 return c - 'a' + 10, true
229 case 'A' <= c && c <= 'F':
230 return c - 'A' + 10, true
231 }
232 return 0, false
233}
234
235var (
236 newlineNormalizer = strings.NewReplacer("\r\n", "\n", "\r", "\n")

Callers 1

unescapeCharFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected