I generated a hash value for a file in python. The value consists of both characters and numbers. If i check the data type of each value, it is showing as string for both letters and numbers. How do I convert the data type of numbers from string to int?
Thanks in Advance!
import hashlib
myl = []
fobj = open('akash.txt','r')
buffer = fobj.read()
hsh = hashlib.sha512()
hsh.update(buffer.encode('utf-8'))
val = hsh.hexdigest()
for i in val:
print(type(i))
fobj.close()
The hash value generated by the code is:
cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e
I expect the output to be as
<class 'str'>
<class 'str'>
<class 'int'>
...
But this is the output Im getting
<class 'str'>
<class 'str'>
<class 'str'>
...