MCPcopy
hub / github.com/canopy-network/canopy / Hash

Function Hash

lib/crypto/hash.go:28–31  ·  view source on GitHub ↗

Hash() executes the global hashing algorithm on input bytes

(msg []byte)

Source from the content-addressed store, hash-verified

26
27// Hash() executes the global hashing algorithm on input bytes
28func Hash(msg []byte) []byte {
29 h := sha256.Sum256(msg)
30 return h[:]
31}
32
33// ShortHash() executes the global hashing algorithm on input bytes
34// and truncates the output to 20 bytes

Callers 15

TestMerkleTreeFunction · 0.92
HashMethod · 0.92
FormatInputIntoSeedFunction · 0.92
GetHashMethod · 0.92
CheckBasicMethod · 0.92
HashMethod · 0.92
TestCheckBlockHeaderFunction · 0.92
TestSetHashFunction · 0.92
TestBlockHeaderJSONFunction · 0.92
TestCheckBlockFunction · 0.92
TestBlockJSONFunction · 0.92

Calls

no outgoing calls

Tested by 15

TestMerkleTreeFunction · 0.74
TestCheckBlockHeaderFunction · 0.74
TestSetHashFunction · 0.74
TestBlockHeaderJSONFunction · 0.74
TestCheckBlockFunction · 0.74
TestBlockJSONFunction · 0.74
TestCertificateSignBytesFunction · 0.74
TestCheckpointHashFunction · 0.74
TestGetHashFunction · 0.74
TestSetFunction · 0.74