Safe Haskell | None |
---|---|
Language | Haskell98 |
BitTorrent metainfo files
- data Torrent = Torrent {}
- data TorrentInfo
- = SingleFile { }
- | MultiFile {
- tFiles :: [TorrentFile]
- tName :: ByteString
- tPieceLength :: Integer
- tPieces :: ByteString
- data TorrentFile = TorrentFile {
- fileLength :: Integer
- filePath :: [ByteString]
- readTorrent :: ByteString -> Either String Torrent
- serializeTorrent :: Torrent -> BEncode
- torrentSize :: Torrent -> Integer
- showTorrent :: Torrent -> ByteString
Documentation
Torrent | |
|
data TorrentInfo Source #
SingleFile | |
| |
MultiFile | |
|
data TorrentFile Source #
TorrentFile | |
|
readTorrent :: ByteString -> Either String Torrent Source #
serializeTorrent :: Torrent -> BEncode Source #
torrentSize :: Torrent -> Integer Source #
Size of the files in the torrent.
showTorrent :: Torrent -> ByteString Source #
generates a torrent file
Due to lexographical ordering requirements of BEncoded data, this should generate the same ByteString that readTorrent read to generate the Torrent. However, torrent files may contain extensions and nonstandard fields that prevent that from holding for all torrent files.