Skip to content

How do you represent bencoded strings that contain a <hex> tag to avoid ambiguity? #7

@josecelano

Description

@josecelano

Relates to: Chocobo1/bencode_online#3

How do you represent bencoded strings that contain a tag to avoid ambiguity with the tags introduced by not utf-8 bencoded strings?

Submitted on reddit by Icarium-Lifestealer

UPDATE

Example, two bencoded values producing the same output:

printf "13:<hex>ff</hex>" | cargo run -> "<hex>ff</hex>"  (13 bytes)
printf "1:\xff"           | cargo run -> "<hex>ff</hex>"  (1 byte)

List of special characters used in JSON that need to be escaped in string values:

  • \b Backspace (ascii code 08)
  • \f Form feed (ascii code 0C)
  • \n New line
  • \r Carriage return
  • \t Tab
  • \" Double quote
  • \\ Backslash character

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions