dimanche 5 novembre 2023

How can I randomize existing byte array?

I create an array of bytes.

array = bytearray(random.randint(1, 8192))

Now how can I randomize each elements of the array?

Just like,

// with Java
var array = new byte[ThreadLocalRandom.current().nextInt(1, 8192)];
ThreadLocalRandom.current().nextBytes(array);



Aucun commentaire:

Enregistrer un commentaire