Documentation ¶
Overview ¶
Compute missing pieces for a torrent.
Index ¶
- func CheckPiece(fs FileStore, totalLength int64, m *MetaInfo, pieceIndex int) (good bool, err error)
- func CheckPieces(fs FileStore, totalLength int64, m *MetaInfo) (good, bad int, err error)
- func ComputePieceSum(fs FileStore, totalLength int64, pieceLength int64, pieceIndex int) (sum []byte, err error)
- func ComputeSums(fs FileStore, totalLength int64, pieceLength int64) (sums []byte, err error)
- func ProgressBar(i, j int) string
- func SetEcho(b bool)
- func VerifyContent(m *MetaInfo, root string) (bool, error)
- func VerifyFull(m *MetaInfo, root string) (bool, error)
- func VerifyPartial(m *MetaInfo, root string) (bool, error)
- func VerifySingle(m *MetaInfo, root string) (bool, error)
- type Bitset
- type FileDict
- type FileStore
- type InfoDict
- type Magnet
- type MetaInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckPiece ¶
func CheckPieces ¶
func ComputePieceSum ¶
func ComputeSums ¶
ComputeSums reads the file content and computes the SHA1 hash for each piece. Spawns parallel goroutines to compute the hashes, since each computation takes ~30ms.
func ProgressBar ¶
Types ¶
type Bitset ¶
type Bitset struct {
// contains filtered or unexported fields
}
func NewBitsetFromBytes ¶
Creates a new bitset from a given byte stream. Returns nil if the data is invalid in some way.
func (*Bitset) IsEndValid ¶
type InfoDict ¶
Click to show internal directories.
Click to hide internal directories.