7.8. Random Byte Generator

Function:

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

Random bytes of length bytes

Return type

[]byte