Skip to main content Link Search Menu Expand Document (external link)

6.8 Random Byte Generator


Functions

RandomBytes(bytes int) (data []byte)

Given a length, return that many randomly generated bytes. Can be used for an IV or symmetric key.

Parameters
bytes (int) - number of random bytes to generate

Returns
data ([]byte) - random bytes of length bytes