Skip to content

Commit

Permalink
Add powerful ROT13. : P
Browse files Browse the repository at this point in the history
  • Loading branch information
sadnoodles committed Apr 7, 2017
1 parent c9a0c25 commit 9bbb058
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Default.sublime-commands
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@
"caption": "XssEncode: ZipEncode",
"command": "zip_encode"
},
{
"caption": "XssEncode: Rot13Decode",
"command": "rot13_decode"
},
{
"caption": "XssEncode: Rot13Encode",
"command": "rot13_encode"
},
{
"caption": "XssEncode: HexToString",
"command": "hex_to_string"
Expand Down
2 changes: 2 additions & 0 deletions Main.sublime-menu
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
{"id": "string_to_hex", "caption": "StringToHex", "command": "string_to_hex"},
{"id": "unzip_decode", "caption": "ZipDecode", "command": "zip_decode"},
{"id": "unzip_encode", "caption": "ZipEncode", "command": "zip_encode"},
{"id": "rot13_decode", "caption": "Rot13Decode", "command": "rot13_decode"},
{"id": "rot13_encode", "caption": "Rot13Encode", "command": "rot13_encode"},
{"id": "hex_to_string", "caption": "HexToString", "command": "hex_to_string"},
{"caption": "-"},
{"id": "unicode_encode", "caption": "UnicodeEncode", "command": "unicode_encode"},
Expand Down
14 changes: 14 additions & 0 deletions xssencode.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,3 +276,17 @@ def convert(self, source_txt):
return codecs.escape_encode(text)[0].decode()
except:
sublime.error_message("Zip failed.")

class Rot13EncodeCommand(XssEncodeCommand):

def convert(self, source_txt):
text = ""
try:
import codecs
text = codecs.encode(source_txt, "rot-13")
return text
except:
sublime.error_message("Rot13 convert failed.")

class Rot13DecodeCommand(Rot13EncodeCommand):
pass

0 comments on commit 9bbb058

Please sign in to comment.