I have a byte array, with a fixed length of 4.
token := make([]byte, 4)
I need to set each byte to a random byte. How can I do so, in the most efficient matter? The math/rand
methods do not provide a Random Byte function, as far as I am concerned.
Perhaps there is a built-in way, or should I go with generating a random string and converting it to a byte array?