random library

Implementation of secure random generators based on hashlib

Classes

Generators
HashlibRandom
Provides a generator for secure random values

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, RandomGenerator generator = RandomGenerator.secure}) → void
Fills the list with random 32-bit numbers.
fillRandom(ByteBuffer buffer, {int start = 0, int? length, RandomGenerator generator = RandomGenerator.secure}) → void
Fills the buffer with random numbers.
randomBytes(int length, {RandomGenerator generator = RandomGenerator.secure}) Uint8List
Generate a list of random 8-bit numbers of size length
randomNumbers(int length, {RandomGenerator generator = RandomGenerator.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, RandomGenerator generator = RandomGenerator.secure}) String
Generate a list of random ASCII string of size length.