MCPcopy Index your code
hub / github.com/perkeep/perkeep / hexVal

Function hexVal

pkg/blob/ref.go:293–302  ·  view source on GitHub ↗

'0' => 0 ... 'f' => 15, else sets *bad to true.

(b byte, bad *bool)

Source from the content-addressed store, hash-verified

291
292// '0' => 0 ... 'f' => 15, else sets *bad to true.
293func hexVal(b byte, bad *bool) byte {
294 if '0' <= b && b <= '9' {
295 return b - '0'
296 }
297 if 'a' <= b && b <= 'f' {
298 return b - 'a' + 10
299 }
300 *bad = true
301 return 0
302}
303
304func validDigestName(name string) bool {
305 if name == "" {

Callers 5

parseUnknownFunction · 0.85
sha1FromHexStringFunction · 0.85
sha1FromHexBytesFunction · 0.85
sha224FromHexStringFunction · 0.85
sha224FromHexBytesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected