BdecodeNode
A node in the tree produced by Bdecode.decode. The port of libtorrent's bdecode_node (bdecode.hpp). Every node keeps a reference to the original parsed buffer plus the byte span it occupies, so dataSection can hand back the exact bytes a node was parsed from. That is what makes correct info-hashing possible: the v1 info-hash is SHA-1(info-dict's dataSection).
libtorrent stores the whole tree as a flat array of 8-byte tokens that index back into the buffer (a neat allocation-free trick). This port uses an ordinary object tree with the same public API; the flat-token representation is a future optimization that would not change a single call site.
Types
Properties
Functions
Byte offset of this node in the originally parsed buffer.
The exact bytes this node was parsed from, including the framing characters (d…e, l…e, i…e, <len>:<bytes>). For the info dictionary this is the preimage of the info-hash.
Raw string bytes (not NUL-terminated, may be binary).
Byte offset of the string content (after the <len>:) in the buffer.
String value decoded as UTF-8, for text fields.