MCPcopy Create free account
hub / github.com/argotorg/solidity / bmtHash

Function bmtHash

libsolutil/SwarmHash.cpp:65–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63}
64
65h256 bmtHash(bytesConstRef _data)
66{
67 if (_data.size() <= 64)
68 return keccak256(_data);
69
70 size_t midPoint = _data.size() / 2;
71 return keccak256(
72 bmtHash(_data.cropped(0, midPoint)).asBytes() +
73 bmtHash(_data.cropped(midPoint)).asBytes()
74 );
75}
76
77h256 chunkHash(bytesConstRef const _data, bool _forceHigherLevel = false)
78{

Callers 1

chunkHashFunction · 0.85

Calls 4

asBytesMethod · 0.80
croppedMethod · 0.80
keccak256Function · 0.70
sizeMethod · 0.45

Tested by

no test coverage detected