GetRandom functionv0.1.0

Source
Fills length bytes of buffer with unpredictable bytes.
pub func GetRandom(buffer: *var opaque, length: uint)

buffer is borrowed and written; length is read by value. Returns nothing, because this cannot fail: the generator is seeded before any user code runs and never blocks. Suitable for a key, a token, or anything an adversary would like to guess. Runs in time proportional to length and allocates nothing. buffer must be writable for length bytes.

Parameters

NameTypeDescription
buffer*var opaquereceives the bytes
lengthuinthow many bytes to write