I have a variable c that contains a string gained from tkinters Entry object. I want to apply a hash function to this string and than transmith it to some other computer.
I've already tried encoding my string with bytes function.
bytes(c)
or encode
function
Else i tried using "cryptography" library and got the same error.
digest = hashlib.sha256()
c = digest.update(c)
c = c.digest()
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Python27\lib\lib-tk\Tkinter.py", line 1547, in __call__
return self.func(*args)
File "C:\Users\HTTPS\Desktop\registration_form.py", line 79, in register
c = c.digest()
AttributeError: 'NoneType' object has no attribute 'digest'
c = digest.update(c)
...should just be:
digest.update(c)
Operations which are called for their side effects in Python return None, to make it clear to callers that they're mutating the object on which they're called rather than returning a new value.