MCPcopy Create free account
hub / github.com/pquerna/ffjson / getu4

Function getu4

fflib/v1/jsonstring.go:243–252  ·  view source on GitHub ↗

getu4 decodes \uXXXX from the beginning of s, returning the hex value, or it returns -1.

(s []byte)

Source from the content-addressed store, hash-verified

241// getu4 decodes \uXXXX from the beginning of s, returning the hex value,
242// or it returns -1.
243func getu4(s []byte) rune {
244 if len(s) < 6 || s[0] != '\\' || s[1] != 'u' {
245 return -1
246 }
247 r, err := strconv.ParseUint(string(s[2:6]), 16, 64)
248 if err != nil {
249 return -1
250 }
251 return rune(r)
252}
253
254// TODO(pquerna): consider combining wibth the normal byte mask.
255var lt [256]bool = [256]bool{

Callers 1

UnquoteBytesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…