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

Method SetBytes

crypto/hash/hash.go:94–103  ·  view source on GitHub ↗

SetBytes sets the bytes which represent the hash. An error is returned if the number of bytes passed in is not HashSize.

(newHash []byte)

Source from the content-addressed store, hash-verified

92// SetBytes sets the bytes which represent the hash. An error is returned if
93// the number of bytes passed in is not HashSize.
94func (h *Hash) SetBytes(newHash []byte) error {
95 nhlen := len(newHash)
96 if nhlen != HashSize {
97 return fmt.Errorf("invalid hash length of %v, want %v", nhlen,
98 HashSize)
99 }
100 copy(h[:], newHash)
101
102 return nil
103}
104
105// IsEqual returns true if target is the same as hash.
106func (h *Hash) IsEqual(target *Hash) bool {

Calls 1

ErrorfMethod · 0.80