Created
December 20, 2016 18:10
-
-
Save aeppert/964a975f0a05fc1d4360dc44e8dc1094 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| def chunker(seq, size): | |
| return (seq[pos:pos + size] for pos in xrange(0, len(seq), size)) | |
| def word_to_ord(s): | |
| ret = '' | |
| for i in s: | |
| ret += str(ord(i)) | |
| return ret | |
| def ord_to_word(o): | |
| ret = '' | |
| for i in chunker(o, 2): | |
| ret += chr(int(i)) | |
| return ret | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment