MCPcopy
hub / github.com/bnb-chain/bsc / BytesToHash

Function BytesToHash

common/types.go:60–64  ·  view source on GitHub ↗

BytesToHash sets b to hash. If b is larger than len(h), b will be cropped from the left.

(b []byte)

Source from the content-addressed store, hash-verified

58// BytesToHash sets b to hash.
59// If b is larger than len(h), b will be cropped from the left.
60func BytesToHash(b []byte) Hash {
61 var h Hash
62 h.SetBytes(b)
63 return h
64}
65
66// BigToHash sets byte representation of b to hash.
67// If b is larger than len(h), b will be cropped from the left.

Callers 15

HashDataFunction · 0.92
Keccak256HashFunction · 0.92
GenerateBadBlockFunction · 0.92
SectionHeadMethod · 0.92
receipt_test.goFile · 0.92
HeaderParentHashFromRLPFunction · 0.92
FullAccountFunction · 0.92
testNodeIteratorCoverageFunction · 0.92
isTrieNodeFunction · 0.92
NewStateSyncFunction · 0.92

Calls 1

SetBytesMethod · 0.95

Tested by 15

GenerateBadBlockFunction · 0.74
testNodeIteratorCoverageFunction · 0.74
isTrieNodeFunction · 0.74
TestSnapshotFunction · 0.74
TestSnapshot2Function · 0.74
TestUpdateLeaksFunction · 0.74
newTestActionFunction · 0.74
TestResetObjectFunction · 0.74
testIterativeStateSyncFunction · 0.74
copyPreimagesFunction · 0.74