MCPcopy
hub / github.com/go-git/go-git / ComputeHash

Function ComputeHash

plumbing/hash.go:19–23  ·  view source on GitHub ↗

ComputeHash compute the hash for a given ObjectType and content

(t ObjectType, content []byte)

Source from the content-addressed store, hash-verified

17
18// ComputeHash compute the hash for a given ObjectType and content
19func ComputeHash(t ObjectType, content []byte) Hash {
20 h := NewHasher(t, int64(len(content)))
21 h.Write(content)
22 return h.Sum()
23}
24
25// NewHash return a new Hash from a hexadecimal hash representation
26func NewHash(s string) Hash {

Callers 4

HashMethod · 0.92
TestComputeHashMethod · 0.85
TestNewHashMethod · 0.85
HashMethod · 0.85

Calls 3

SumMethod · 0.95
NewHasherFunction · 0.85
WriteMethod · 0.45

Tested by 3

HashMethod · 0.74
TestComputeHashMethod · 0.68
TestNewHashMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…