mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-03-19 21:19:47 +00:00
Fixed error on chr function when decrypt (#359)
On line 23 when make the operations returns a float and chr function doesn't permit float values as parameters.
This commit is contained in:
parent
93de559ff6
commit
c0f7df7e22
@ -20,7 +20,7 @@ class Onepad:
|
|||||||
'''Function to decrypt text using psedo-random numbers.'''
|
'''Function to decrypt text using psedo-random numbers.'''
|
||||||
plain = []
|
plain = []
|
||||||
for i in range(len(key)):
|
for i in range(len(key)):
|
||||||
p = (cipher[i]-(key[i])**2)/key[i]
|
p = int((cipher[i]-(key[i])**2)/key[i])
|
||||||
plain.append(chr(p))
|
plain.append(chr(p))
|
||||||
plain = ''.join([i for i in plain])
|
plain = ''.join([i for i in plain])
|
||||||
return plain
|
return plain
|
||||||
|
Loading…
x
Reference in New Issue
Block a user