I wrote this code to split a big number into smaller parts in a certain range. Now i am trying to randomize it but I'm not sure what module to use in random function and I'm stuck. Pardon my English
import random
op = ''
start = 664613997892457936451903530140172288
step = 9223372036854775808
stop = 1329227995784915872903807060280344575
while start <= stop:
print( hex(start).lstrip("0x") + ':' + hex(start+step).lstrip("0x") )
start += step
f = open("op.txt", "a")
f.write(op)
f.close()
The start is 800000000000000000000000000000 in hexadecimal, the stop is FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF and the difference between each step is 8000000000000000 in hexadecimal. When I run the code the numbers are generated in sequence like this:
800000000000000000000000000000:800000000000008000000000000000
800000000000008000000000000000:800000000000010000000000000000
800000000000010000000000000000:800000000000018000000000000000
800000000000018000000000000000:800000000000020000000000000000
800000000000020000000000000000:800000000000028000000000000000
800000000000028000000000000000:800000000000030000000000000000
800000000000030000000000000000:800000000000038000000000000000
800000000000038000000000000000:800000000000040000000000000000
800000000000040000000000000000:800000000000048000000000000000
800000000000048000000000000000:800000000000050000000000000000
800000000000050000000000000000:800000000000058000000000000000
800000000000058000000000000000:800000000000060000000000000000
800000000000060000000000000000:800000000000068000000000000000
800000000000068000000000000000:800000000000070000000000000000
800000000000070000000000000000:800000000000078000000000000000
800000000000078000000000000000:800000000000080000000000000000
800000000000080000000000000000:800000000000088000000000000000
800000000000088000000000000000:800000000000090000000000000000
800000000000090000000000000000:800000000000098000000000000000
800000000000098000000000000000:8000000000000a0000000000000000
8000000000000a0000000000000000:8000000000000a8000000000000000
8000000000000a8000000000000000:8000000000000b0000000000000000
8000000000000b0000000000000000:8000000000000b8000000000000000
8000000000000b8000000000000000:8000000000000c0000000000000000
Is it possible to generate random values between 800000000000000000000000000000 and FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF but with same step (8000000000000000 ) value, where the numbers generated are random, not in sequence?
I tried using random.randint(start,stop)
but it just doesn't seem to work.
I am trying to achieve my output from
800000000000000000000000000000:800000000000008000000000000000
800000000000008000000000000000:800000000000010000000000000000
800000000000010000000000000000:800000000000018000000000000000
800000000000018000000000000000:800000000000020000000000000000
800000000000020000000000000000:800000000000028000000000000000
800000000000028000000000000000:800000000000030000000000000000
800000000000030000000000000000:800000000000038000000000000000
800000000000038000000000000000:800000000000040000000000000000
800000000000040000000000000000:800000000000048000000000000000
800000000000048000000000000000:800000000000050000000000000000
800000000000050000000000000000:800000000000058000000000000000
800000000000058000000000000000:800000000000060000000000000000
800000000000060000000000000000:800000000000068000000000000000
800000000000068000000000000000:800000000000070000000000000000
800000000000070000000000000000:800000000000078000000000000000
to
b4459257eda6b45af82611586bf8c6:b4459257eda6b48000000000000000
ca60da4d4a4ee38000000000000000:ca60da4d4a4ee31000000000000000
c8572366d667810000000000000000:c8572366d667818000000000000000
e5dc56311189018000000000000000:e5dc56311189020000000000000000
a324eb157a00e20000000000000000:a324eb157a00e28000000000000000
ff5b961d3b87d28000000000000000:ff5b961d3b87d30000000000000000
I'm sorry I had to put in examples, I just wanted to make sure that everyone understood my question as my English is bad.