GetRandom functionv0.1.0
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
| Name | Type | Description |
|---|---|---|
buffer | *var opaque | receives the bytes |
length | uint | how many bytes to write |