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

Function sha1FromHexString

pkg/blob/ref.go:361–371  ·  view source on GitHub ↗
(hex string)

Source from the content-addressed store, hash-verified

359}
360
361func sha1FromHexString(hex string) (digestType, bool) {
362 var d sha1Digest
363 var bad bool
364 for i := 0; i < len(hex); i += 2 {
365 d[i/2] = hexVal(hex[i], &bad)<<4 | hexVal(hex[i+1], &bad)
366 }
367 if bad {
368 return nil, false
369 }
370 return d, true
371}
372
373// yawn. exact copy of sha1FromHexString.
374func sha1FromHexBytes(hex []byte) (digestType, bool) {

Callers

nothing calls this directly

Calls 1

hexValFunction · 0.85

Tested by

no test coverage detected