Skip to content

RandBytes

[Source]

Generate cryptographically secure random bytes using OpenSSL's CSPRNG.

Returns an array of the requested number of random bytes, or raises an error if the CSPRNG cannot generate secure output (e.g., insufficient entropy during early system startup).

let nonce = RandBytes(24)?
primitive val RandBytes

Constructors

create

[Source]

new val create()
: RandBytes val^

Returns


Public Functions

apply

[Source]

fun tag apply(
  size: USize val)
: Array[U8 val] val ?

Parameters

Returns


eq

[Source]

fun box eq(
  that: RandBytes val)
: Bool val

Parameters

Returns


ne

[Source]

fun box ne(
  that: RandBytes val)
: Bool val

Parameters

Returns