Created
July 11, 2023 10:23
-
-
Save nazariyv/88340bfac4673013ec11e5f54e0c9c5d to your computer and use it in GitHub Desktop.
throw away ethereum private key
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
def int_to_privkey(n): | |
hex_n = hex(n)[2:] # convert to hexadecimal and strip the "0x" prefix | |
return hex_n.rjust(64, '0') # pad with zeros to the left until it's 64 characters long | |
int_to_privkey(random.randing(0, 2 ** 256 - 1)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment