random library

Implementation of secure random generators based on hashlib

Classes

HashlibRandom
Provides a generator for secure random values

Enums

Namespace
RNG
Available Random Number Generators

Extensions

NamespaceValue on Namespace
Adds a value attribute to Namespace enum to get the string value.

Constants

uuid → const _UUID
A UUID is 128 bits long and is intended to guarantee uniqueness. This class contains implementations for different versions of UUIDs based on the specification from RFC-9562.

Functions

fillNumbers(List<int> list, {int start = 0, int? length, RNG generator = RNG.secure}) → void
Fills the list with random 32-bit numbers.
fillRandom(ByteBuffer buffer, {int start = 0, int? length, RNG generator = RNG.secure}) → void
Fills the buffer with random numbers.
randomBytes(int length, {RNG generator = RNG.secure}) Uint8List
Generate a list of random 8-bit numbers of size length
randomNumbers(int length, {RNG generator = RNG.secure}) Uint32List
Generate a list of random 32-bit numbers of size length
randomString(int length, {bool? lower, bool? upper, bool? numeric, bool? controls, bool? punctuations, List<int>? whitelist, List<int>? blacklist, RNG generator = RNG.secure}) String
Generate a list of random ASCII string of size length.