package
bencoding with Buffers instead of strings
npm install dht-bencodeGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
bencode with Buffer()s from nodejs (as it is binary data, javascript string are not a good idea to handle it)
npm install dht-bencodevar bencode = require('dht-bencode');
bencode.bencode({ t: 'ab' }).toString(); // should result in "d1:t2:abe"
bencode.bdecode("d1:t2:abe"); // should result in { t: <Buffer 61 62> }