MCPcopy
hub / github.com/perkeep/perkeep / SHA256Prefix

Function SHA256Prefix

internal/hashutil/hashutil.go:32–36  ·  view source on GitHub ↗

SHA256Prefix computes the SHA-256 digest of data and returns its first twenty lowercase hex digits.

(data []byte)

Source from the content-addressed store, hash-verified

30// SHA256Prefix computes the SHA-256 digest of data and returns
31// its first twenty lowercase hex digits.
32func SHA256Prefix(data []byte) string {
33 h := sha256.New()
34 h.Write(data)
35 return fmt.Sprintf("%x", h.Sum(nil))[:20]
36}
37
38// SHA1Prefix computes the SHA-1 digest of data and returns
39// its first twenty lowercase hex digits.

Callers 3

http2DialTLSFuncMethod · 0.92
DialTLSFuncMethod · 0.92
CertFingerprintFunction · 0.92

Calls 2

SumMethod · 0.80
WriteMethod · 0.45

Tested by

no test coverage detected