direct-connect / go-dc

Direct Connect library for Go (NMDC and ADC protocols)
BSD 3-Clause "New" or "Revised" License
10 stars 5 forks source link

tiger: add leaves.ToTreeHash() #5

Closed aler9 closed 5 years ago

aler9 commented 5 years ago

A client must provide both leaves and TTH for every file. the most efficient way to do so is computing first the leaves and then the TTH from the leaves.

In this way we provide the most efficient way to compute TTH directly though TreeHash(), and the most efficient way to compute TTH from leaves through leaves.ToTreeHash().