Skip to content

Commit

Permalink
changed name, added simple test
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeMerz committed Sep 10, 2020
1 parent 509f318 commit 1d18fda
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions ciphey/basemods/Decoders/url.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 7,8 @@
@registry.register_multi((str, str), (bytes, bytes))
class URL(Decoder[T, U]):
def decode(self, ctext: T) -> Optional[U]:
"""Write the code that decodes here
ctext -> the input to the function
returns string"""
"""Given a string the function will try and decode URL coding,
returns string if indeed URL coding else returns None"""
ctext = ctext.replace(" ", " ") # replace sign with spacebar for unquote
result = unquote(ctext) #built-in function that decodes URL coding
if ctext != result:
Expand Down

0 comments on commit 1d18fda

Please sign in to comment.