文件名称:TorrentParser
介绍说明--下载内容均来自于网络,请自行研究使用
实现的封装类CTorrentParser,完成的主要任务有:
1.判断torrent文件是否有效
2.得到如下的重要信息:
tracker服务器列表
文件列表
分块尺寸
分块个数
分块sha1的数组
3.其他的一些次要信息如发布者,发布日期,注释等
4.计算infohash
-Metainfo files are bencoded dictionaries with the following keys:
announce
The URL of the tracker.
info
This maps to a dictionary, with keys described below.
The name key maps to a string which is the suggested name to save the file (or directory) as. It is purely advisory.
piece length maps to the number of bytes in each piece the file is split into. For the purposes of transfer, files are split into fixed-size pieces which are all the same length except for possibly the last one which may be truncated. Piece length is almost always a power of two, most commonly 218 = 256 K (BitTorrent prior to version 3.2 uses 220 = 1 M as default).
pieces maps to a string whose length is a multiple of 20. It is to be subdivided into strings of length 20, each of which is the SHA1 hash of the piece at the corresponding index.
There is also a key length or a key files, but not both or neither. If length is present then the download represents a single file, otherwise it represent
1.判断torrent文件是否有效
2.得到如下的重要信息:
tracker服务器列表
文件列表
分块尺寸
分块个数
分块sha1的数组
3.其他的一些次要信息如发布者,发布日期,注释等
4.计算infohash
-Metainfo files are bencoded dictionaries with the following keys:
announce
The URL of the tracker.
info
This maps to a dictionary, with keys described below.
The name key maps to a string which is the suggested name to save the file (or directory) as. It is purely advisory.
piece length maps to the number of bytes in each piece the file is split into. For the purposes of transfer, files are split into fixed-size pieces which are all the same length except for possibly the last one which may be truncated. Piece length is almost always a power of two, most commonly 218 = 256 K (BitTorrent prior to version 3.2 uses 220 = 1 M as default).
pieces maps to a string whose length is a multiple of 20. It is to be subdivided into strings of length 20, each of which is the SHA1 hash of the piece at the corresponding index.
There is also a key length or a key files, but not both or neither. If length is present then the download represents a single file, otherwise it represent
(系统自动生成,下载前可以参看下载内容)
下载文件列表
TorrentParser
.............\TorrentParser.cpp
.............\TorrentParser.h
.............\TorrentParser.cpp
.............\TorrentParser.h