bencoding

Why is hashing the info dict turning out wrong?

百般思念 提交于 2019-12-24 00:46:38
问题 I have been trying for ages to get this hashing thing for BitTorrent to work in Java but it always becomes wrong. I have narrowed it down to a few lines of code where I'm 99% sure the problem is: Bencode bencode = new Bencode(Charset.forName("UTF-8")); byte[] fileBytes = new byte[33237]; Map<String, Object> dict = bencode.decode(fileBytes, Type.DICTIONARY); Map infoMap = (Map) object.get("info"); ByteArrayOutputStream baos = new ByteArrayOutputStream(); BencodeOutputStream bos = new

Decode (BEncode) torrent files

荒凉一梦 提交于 2019-12-06 11:14:11
问题 Hello I'm making a Console app in VS15 using C#. How can I decode torrent files? To get the Name, Size and Date of the torrent file? I want to donwload a torrent file from a server and then decode it to see the name, size and date. So far i can download a file using WebCLient, but i have search and search for how to decode a torrent file, but without luck. I have tried this library and did this: using (var fs = File.OpenRead("Ubuntu.torrent")) { BDictionary bdictionary = Bencode

Decode (BEncode) torrent files

ぃ、小莉子 提交于 2019-12-04 15:35:13
Hello I'm making a Console app in VS15 using C#. How can I decode torrent files? To get the Name, Size and Date of the torrent file? I want to donwload a torrent file from a server and then decode it to see the name, size and date. So far i can download a file using WebCLient, but i have search and search for how to decode a torrent file, but without luck. I have tried this library and did this: using (var fs = File.OpenRead("Ubuntu.torrent")) { BDictionary bdictionary = Bencode.DecodeDictionary(fs); } But i don't quite understand what bdictionary gives me? I want to output the torrents