MCPcopy
hub / github.com/go-yaml/yaml / as_hex

Function as_hex

yamlprivateh.go:68–77  ·  view source on GitHub ↗

Get the value of a hex-digit.

(b []byte, i int)

Source from the content-addressed store, hash-verified

66
67// Get the value of a hex-digit.
68func as_hex(b []byte, i int) int {
69 bi := b[i]
70 if bi >= 'A' && bi <= 'F' {
71 return int(bi) - 'A' + 10
72 }
73 if bi >= 'a' && bi <= 'f' {
74 return int(bi) - 'a' + 10
75 }
76 return int(bi) - '0'
77}
78
79// Check if the character is ASCII.
80func is_ascii(b []byte, i int) bool {

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected