Post
Topic
Board Development & Technical Discussion
Re: Python HEX generator Range based
by
archyone
on 26/04/2021, 11:20:08 UTC
Hi, you can use secrets library.. "pip install secrets"

Code:
import secrets

for n in range(100): # replace 100 by your number of time
 bits = secrets.randbits(256) # replace 256 by your choosen range (here this is the number of bits)
 with open('result.txt', 'a') as file:
  file.write("\n" + hex(bits)[2:])


et voila !  Wink