在终端中打印二进制打包随机数时,它会生成一堆警报。
该程序的代码是:
from struct import pack, unpack
import hashlib
import sys
print "Input the message you want to work on:"
message = raw_input()
orig_hash = hashlib.sha512(message).digest()
trialValue = 99999999999999999999
target = 4103215547750
nonce = 0
while trialValue > target:
nonce += 1
packed_nonce = pack('>Q', nonce)
print packed_nonce
trialValue, = unpack('>Q',hashlib.sha512(packed_nonce + orig_hash).digest()[0:8])
print nonce
print trialValue
这没什么大不了的,但是有人知道为什么会这样吗?