Safe Haskell | None |
---|---|
Language | Haskell98 |
Data.Torrent
Description
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
Constructors
Torrent | |
Fields
|
data TorrentInfo #
Constructors
SingleFile | |
Fields
| |
MultiFile | |
Fields
|
Instances
data TorrentFile #
Constructors
TorrentFile | |
Fields
|
Instances
readTorrent :: ByteString -> Either String Torrent #
serializeTorrent :: Torrent -> BEncode #
torrentSize :: Torrent -> Integer #
Size of the files in the torrent.
showTorrent :: Torrent -> ByteString #
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.