News for hackers. Stuff that matters.
Re:Building a BitTorrent client from scratch in C# by ambicapter on Tuesday July 05, 2016 @12:58PM (#12037829)
I don't understand this encoding method. If say, a dictionary starts with d and ends with e, how do you know with "d3:key5:valuee" if the value is "value" or "valu"?
Re:Building a BitTorrent client from scratch in C# by sigcode on Wednesday July 06, 2016 @09:33AM (#12042923)
Re:Building a BitTorrent client from scratch in C# by robteix on Tuesday July 05, 2016 @01:03PM (#12037869)
Because the value is actually "5:value", which means it's 5 bytes long. The final 'e' indicates the end of the dictionary, not the value.
Re:Building a BitTorrent client from scratch in C# by nemaar on Tuesday July 05, 2016 @01:01PM (#12037853)
The length of the string is included, so you know where it ends.