How to efficiently store large integers in arrays

I wrote an example of storing an array of large numbers:

big_num = 6400
mask = (1 << 64) - 1
for i in range(100):
     arr[i] = big_num & mask
     big_num >>= 64

the actual measurement is slow
how to write efficiently

Sep.22,2021

python3 has built-in large integers,

>>> 2**1000
10715086071862673209484250490600018105614048117055336074437503883703510511249361224931983788156958581275946729175531468251871452856923140435984577574698574803934567774824230985421074605062371141877954182153046474983581941267398767559165543946077062914571196477686542167660429831652624386837205668069376
Menu