MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / NewHash

Function NewHash

crypto/hash/hash.go:174–181  ·  view source on GitHub ↗

NewHash returns a new Hash from a byte slice. An error is returned if the number of bytes passed in is not HashSize.

(newHash []byte)

Source from the content-addressed store, hash-verified

172// NewHash returns a new Hash from a byte slice. An error is returned if
173// the number of bytes passed in is not HashSize.
174func NewHash(newHash []byte) (*Hash, error) {
175 var sh Hash
176 err := sh.SetBytes(newHash)
177 if err != nil {
178 return nil, err
179 }
180 return &sh, err
181}
182
183// NewHashFromStr creates a Hash from a hash string. The string should be
184// the hexadecimal string of a byte-reversed hash, but any missing characters

Callers 4

GetLocalNodeIDFunction · 0.92
UnmarshalBinaryMethod · 0.92
serverHandshakeMethod · 0.92
TestHashFunction · 0.85

Calls 1

SetBytesMethod · 0.95

Tested by 1

TestHashFunction · 0.68