Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class a():
- def __init__(self,b):
- self.key = b
- def encode(self,b):
- h = ''
- for i in b:
- h += chr(ord(i) + self.key)
- return h
- def decode(self,b):
- h = ''
- for i in b:
- h += chr(ord(i) - self.key)
- return h
- m = a(5)
- k = m.encode('hhjj')
- print (k)
- print (m.decode(k))
Add Comment
Please, Sign In to add comment