您好我正在使用python2.7创建一个简单的程序,其中第一个输入是十六进制(32字节),将被哈希并递增1.新值将再次进行哈希处理并再次递增。该过程将重复,直到满足指定的范围。
但是我收到了int()
的错误TypeError: int() can't convert non-string with explicit base
以下是我的程序代码
from coinkit.address import Address
import hashlib
h = hashlib.new('ripemd160') # <-- Create the hash
a = Address.from_secret('0000000000000000000000000000000000000000000000000000000000000001') #where the input will be hash
for i in range (0, 10): # should have 10 outputs
intVal = int(a, 16) # convert to hex
intVal += 1 # increment by 1
h.update(hex(intVal)) # <-- Update the hash with the new incremented integer
a = Address.from_secret(h.hexdigest()) # <-- Get the digest and feed it back into from_secret
print a.pub, a.priv # <-- print new 'a' values
我确实尝试删除16它会引发错误:
TypeError : int() argument must be a string or a number, not 'Address'
请赐教。谢谢。