task3 #2
@ -15,10 +15,9 @@ class VigenereCipher(object):
|
||||
|
||||
pos = (text_pos + key_pos) % len(self.alphabet)
|
||||
encoded.append(self.alphabet[pos])
|
||||
|
||||
idx_key += 1
|
||||
else:
|
||||
encoded.append(char)
|
||||
idx_key += 1
|
||||
|
||||
return "".join(encoded)
|
||||
|
||||
@ -34,9 +33,8 @@ class VigenereCipher(object):
|
||||
|
||||
pos = (text_pos - key_pos) % len(self.alphabet)
|
||||
decoded.append(self.alphabet[pos])
|
||||
|
||||
idx_key += 1
|
||||
else:
|
||||
decoded.append(char)
|
||||
idx_key += 1
|
||||
|
||||
return "".join(decoded)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user