CryptoSys PKI Pro Manual

Rng.Bytes(Int32) Method

Generate an array of random bytes.

Syntax

[C#]
public static byte[] Bytes(
   int numBytes 
)
[VB]
Public Shared Function Bytes (
   numBytes As Integer 
) As Byte()

Parameters

numBytes  Int32
Required number of random bytes

Return Value

Byte
Array of random bytes

Example

byte[] b = Rng.Bytes(16);
Console.WriteLine("Rng.Bytes(16)={0}", b.ToHex());
// e.g. 3FD45EB7715CE91C9F1DB69DBF6677ED (always different)

See Also

VB6/C equivalent: RNG_Bytes

[Contents] [Index]

[PREV: Pwd.Prompt Method...]   [Contents]   [Index]   
   [NEXT: Rng.Bytes(Int32, Byte) Method...]

Copyright © 2004-26 D.I. Management Services Pty Ltd t/a CryptoSys. All rights reserved. Generated 2026-09-21T05:59:39Z.