我一直在尝试在Erlang中解析torrent文件,到目前为止,我能够提取所有的一般信息,如torrent名称、文件(长度、路径、名称)、跟踪器链接。。。
The only thing that is bothering me is the sha1 hash value. I checked many websites online and according to the specification the "info" dictionary is what needs to be hashed. However, I m still confused by the delimiters. Should d and e be included or not?
最后,我认为如何从文件中读取数据很重要,现在我将文件读取为二进制文件,然后在解析数据之前将其转换为列表。如果生成哈希,这是否会更改/损坏哈希?是否有合适的数据类型(二进制/列表)能够正确提取信息字典。
提前谢谢。