MCPcopy Create free account
hub / github.com/chain/Core / NewHash

Function NewHash

protocol/bc/hash.go:19–25  ·  view source on GitHub ↗
(b32 [32]byte)

Source from the content-addressed store, hash-verified

17var EmptyStringHash = NewHash(sha3.Sum256(nil))
18
19func NewHash(b32 [32]byte) (h Hash) {
20 h.V0 = binary.BigEndian.Uint64(b32[0:8])
21 h.V1 = binary.BigEndian.Uint64(b32[8:16])
22 h.V2 = binary.BigEndian.Uint64(b32[16:24])
23 h.V3 = binary.BigEndian.Uint64(b32[24:32])
24 return h
25}
26
27func (h Hash) Byte32() (b32 [32]byte) {
28 binary.BigEndian.PutUint64(b32[0:8], h.V0)

Callers 5

NewAssetIDFunction · 0.85
hash.goFile · 0.85
UnmarshalTextMethod · 0.85
ScanMethod · 0.85
ReadFromMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected