Skip to content

Commit 838ffc0

Browse files
committed
docs: update README.md
1 parent 9f38ef6 commit 838ffc0

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Bencode2Json
1+
# Torrust Bencode2Json
22

3-
[![Testing](https://github.com/torrust/bencode2json/actions/workflows/testing.yaml/badge.svg)](https://github.com/torrust/bencode2json/actions/workflows/testing.yaml) [![codecov](https://codecov.io/gh/torrust/bencode2json/branch/develop/graph/badge.svg?token=G5IK5HV2EW)](https://codecov.io/gh/torrust/bencode2json)
3+
[![Testing](https://github.com/torrust/bencode2json/actions/workflows/testing.yaml/badge.svg)](https://github.com/torrust/bencode2json/actions/workflows/testing.yaml)
44

55
A lib and console command to convert from bencoded data to JSON format.
66

@@ -32,19 +32,19 @@ Run the binary with stdin and stdout (UTF-8):
3232

3333
```console
3434
echo "4:spam" | cargo run
35-
"spam"
35+
"<string>spam</string>"
3636
```
3737

3838
Run the binary with stdin and stdout (non UTF-8):
3939

4040
```console
4141
printf "d3:bar2:\xFF\xFEe" | cargo run
42-
{"bar":"<hex>fffe</hex>"}
42+
{"<string>bar</string>":"<hex>fffe</hex>"}
4343
```
4444

4545
```console
4646
printf "d2:\xFF\xFE3:bare" | cargo run
47-
{"<hex>fffe</hex>":"bar"}
47+
{"<hex>fffe</hex>":"<string>bar</string>"}
4848
```
4949

5050
> NOTICE: We need two escape the two bytes `FF` and `FE` with `\x` inside the string.
@@ -53,7 +53,7 @@ More examples:
5353

5454
```console
5555
cat ./tests/fixtures/sample.bencode | cargo run
56-
["spam"]
56+
["<string>spam</string>"]
5757
```
5858

5959
More examples with invalid Bencode:
@@ -81,9 +81,9 @@ echo "d3:foold3:bari42eeee" | cargo run | jq
8181

8282
```json
8383
{
84-
"foo": [
84+
"<string>foo</string>": [
8585
{
86-
"bar": 42
86+
"<string>bar</string>": 42
8787
}
8888
]
8989
}
@@ -121,7 +121,7 @@ use bencode2json::{try_bencode_to_json};
121121

122122
let result = try_bencode_to_json(b"d4:spam4:eggse").unwrap();
123123

124-
assert_eq!(result, r#"{"spam":"eggs"}"#);
124+
assert_eq!(result, r#"{"<string>spam</string>":"<string>eggs</<string>string>"}"#);
125125
```
126126

127127
Example using the low-level parser:
@@ -137,7 +137,7 @@ parser
137137
.write_str(&mut output)
138138
.expect("Bencode to JSON conversion failed");
139139

140-
println!("{output}"); // It prints the JSON string: "spam"
140+
println!("{output}"); // It prints the JSON string: "<string>spam</string>"
141141
```
142142

143143
More [examples](./examples/).
@@ -229,7 +229,7 @@ Some files include explicit copyright notices and/or license notices.
229229

230230
### Legacy Exception
231231

232-
For prosperity, versions of Bencode2Json that are older than five years are automatically granted the [MIT-0][MIT_0] license in addition to the existing [LGPL-3.0-only][LGPL_3_0] license.
232+
For prosperity, versions of Torrust Bencode2Json that are older than five years are automatically granted the [MIT-0][MIT_0] license in addition to the existing [LGPL-3.0-only][LGPL_3_0] license.
233233

234234
[LGPL_3_0]: ./LICENSE
235235
[MIT_0]: ./docs/licenses/LICENSE-MIT_0

0 commit comments

Comments
 (0)