Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def scramble(data):
- res = bytearray()
- print(data[0], type(data))
- for d in data:
- print(d, 97)
- res += bytes([d, 97])
- res = bytes(res)
- print(res)
- return bytes(res)
- def unscramble(data):
- res = bytearray()
- c = 0
- for d in data:
- if not c % 2:
- res.append(d)
- c+=1
- return bytes(res)
- test = scramble(open("test.txt", "rb").read())
- print(unscramble(test))
Add Comment
Please, Sign In to add comment