Documentation ¶
Index ¶
- Constants
- func CompactLayerToSliceHashes(compactLayer string) (hashes [][sha256.Size]byte, err error)
- func Log2RoundingUp(n uint) (ret uint)
- func Root(hashes [][sha256.Size]byte) [sha256.Size]byte
- func RootWithPadHash(hashes [][sha256.Size]byte, padHash [sha256.Size]byte) [sha256.Size]byte
- func RoundUpToPowerOfTwo(n uint) (ret uint)
- type Hash
Constants ¶
View Source
const BlockSize = 1 << 14 // 16KiB
The leaf block size for BitTorrent v2 Merkle trees.
Variables ¶
This section is empty.
Functions ¶
func Log2RoundingUp ¶
func RootWithPadHash ¶
func RoundUpToPowerOfTwo ¶
Types ¶
type Hash ¶
type Hash struct {
// contains filtered or unexported fields
}
func (*Hash) SumMinLength ¶
Sums by extending with zero hashes for blocks missing to meet the given length. Necessary for piece layers hashes for file tail blocks that don't pad to the piece length.
Click to show internal directories.
Click to hide internal directories.