0

Generate a 64 byte hex number

I want to generate a 64 byte hex number with a recurring pattern but would prefer not to enter a loooooooong string and I may want 128 byte equivalent at a later date hex_inner = 0x5c5c5c5c5c............. Is there a way to populate hex_inner with a short format statement....

8th Nov 2016, 9:29 PM
Robert McC
Robert McC - avatar
2 Answers
+ 3
You can do it with bit shifting. hex_inner = 0 for i in range(0,64): hex_inner |= 0x5c << (i * 8)
8th Nov 2016, 9:36 PM
Schindlabua
Schindlabua - avatar
0
Thanks for that much appreciated
8th Nov 2016, 10:42 PM
Robert McC
Robert McC - avatar