Development · Native API migration preview · Coverage validation in progress Published release →

API Browser

Method

Fill

static func Fill(destination: Slice<byte>) -> Result<void, CryptographyError>

Declaring type: RandomNumberGenerator
Module: System.Security.Cryptography
Assembly: System.Runtime.dll
Source file: RandomNumberGenerator.rvn

Fills the entire buffer with secure random bytes.

Parameters

Name Type Description
destination Slice<Byte> Writable byte slice; empty buffers succeed without requesting randomness.

Return value

Result<void, CryptographyError>

Ok(unit), or Failure(ProviderFailure) after clearing the entire destination slice.

Remarks

Invalid managed storage is a terminal fault.