Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • $\begingroup$ Apply your code and get wrong result. Example file: chocobo1.github.io/bencode_online $\endgroup$ Commented May 5, 2024 at 7:01
  • $\begingroup$ @李子涵 Fixed. I was only handling strings of length 0-9 before. $\endgroup$ Commented May 5, 2024 at 14:00
  • $\begingroup$ Perfect application for expression with head! $\endgroup$ Commented May 9, 2024 at 15:52
  • $\begingroup$ BEInterpret[BEString,codes_]:=Quiet[Check[FromCharacterCode[codes,"UTF-8"],StringJoin[IntegerString[#,16]]&/@Partition[codes,UpTo[20]]]]; So it can support non-ASCII file names and convert piece hashes to hexstring. $\endgroup$ Commented May 14, 2024 at 11:27