私は次のコードでいくつかの実験を行っています:
import hashlib
password = 16
n = 2 #counter
hash = hashlib.sha256(str(password) + str(n)).hexdigest() #will read the password as string and hash
print hash
000000 ... 0002のような32byteの16進数を受け入れることができるように、適切なコードは何でしょうか?
回答:
回答№1は1Pythonの16進数は、単なる整数の書き込み方法です。だから簡単に設定 password
あなたの16進値に:
password = 0x00000000000000000000000000000002