Skip to content

Commit c0f7df7

Browse files
jonathangomzharshildarji
authored andcommitted
Fixed error on chr function when decrypt (TheAlgorithms#359)
On line 23 when make the operations returns a float and chr function doesn't permit float values as parameters.
1 parent 93de559 commit c0f7df7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ciphers/Onepad_Cipher.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def decrypt(self, cipher, key):
2020
'''Function to decrypt text using psedo-random numbers.'''
2121
plain = []
2222
for i in range(len(key)):
23-
p = (cipher[i]-(key[i])**2)/key[i]
23+
p = int((cipher[i]-(key[i])**2)/key[i])
2424
plain.append(chr(p))
2525
plain = ''.join([i for i in plain])
2626
return plain

0 commit comments

Comments
 (0)