You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm looking to generate the private key from a specific rage I figured it would be something like changing priv_key = urandom(32) to something that lets me select a range.
my experience is complete noobish beginner so everything I tried stopped the programme from running
The text was updated successfully, but these errors were encountered:
actually managed to fix this myself, not sure if its the best way though
hex_num = "%03x" % random.randint(0x8000000000000000, 0xffffffffffffffff)
add_zero = (str(hex_num).zfill(64))
byte_array = bytearray.fromhex(add_zero)
priv_key = byte_array
fullkey = '80' + binascii.hexlify(priv_key).decode()
sha256a = hashlib.sha256(binascii.unhexlify(fullkey)).hexdigest()
sha256b = hashlib.sha256(binascii.unhexlify(sha256a)).hexdigest()
WIF = base58.b58encode(binascii.unhexlify(fullkey+sha256b[:8]))
I'm looking to generate the private key from a specific rage I figured it would be something like changing priv_key = urandom(32) to something that lets me select a range.
my experience is complete noobish beginner so everything I tried stopped the programme from running
The text was updated successfully, but these errors were encountered: