bencode, bdecode
Created on Jan. 16, 2017 by Julien Palard
Expose two functions bencode and bdecode.
bencodetake one object as a parameter and returnsbytes.bdecodetakebytesas a parameter and returns an object.
objects may be of type:
strintlistdict
You have to follow the bencode encoding and decoding algorithm, see
Wikipedia bencode page.
You'll have to encode and decode strings, use "UTF-8" everywhere and explicitly.
Hints
You may code other helper functions in your module,
functions to help bencode and bdecode in their work. You also can
store module variables and use them but only
for you to use.
There's no corrections yet, hit the `Submit` button to send your code to the correction bot.
Keyboard shortcuts:
- Ctrl-Enter: Send your code to the correction bot.
- Escape: Get back to the instructions tab.