File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change 1+ # Bencode codecs
2+
3+ Implements [ Bencode] [ bencode ] encoder and decoder.
4+
5+ [ bencode ] : https://en.wikipedia.org/wiki/Bencode
6+
7+ Type coercion:
8+
9+ - Strings and ` Uint8Array ` are encoded as Bencode byte strings, decoded as ` Uint8Array ` .
10+ - ` Object ` and ` Map ` are encoded as Bencode dictionaries, decoded as ` Object ` .
11+ - ` Array ` and ` Set ` are encoded as Bencode lists, decoded as ` Array ` .
12+ - ` number ` and ` bigint ` are encoded as Bencode integers, decoded as ` number ` .
13+ - Float ` number ` are rounded and encoded as Bencode integers, decoded as ` number ` .
14+
15+
16+ ## Extensions
17+
18+ This codec extends the Bencode specification to support the following types:
19+
20+ - ` null ` (encoded as ` n ` )
21+ - ` undefined ` (encoded as ` u ` )
22+ - ` boolean ` (encoded as ` t ` for ` true ` and ` f ` for ` false ` )
You can’t perform that action at this time.
0 commit comments