HashlibRandom class
Provides a generator for secure random values
Constructors
- HashlibRandom(RNG generator, {int? seed})
-
Creates an instance based on
generator
with optionalseed
value.factory - HashlibRandom.custom(NextIntFunction _nextInt)
-
Create a instance with custom generator
const
- HashlibRandom.secure({int? seed})
-
Creates an instance based on RNG.secure generator with
optional
seed
value.factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
fill(
ByteBuffer buffer, [int offsetInBytes = 0, int? lengthInBytes]) → void - Fill the buffer with random values.
-
nextBetween(
int low, int high) → int -
Generates a 32-bit bit random number between
low
andhigh
, inclusive. -
nextBool(
) → bool - Generates a boolean value
-
nextByte(
) → int - Generates a 8-bit bit random number
-
nextBytes(
int length) → Uint8List -
Generate a list of random 8-bit bytes of size
length
-
nextDouble(
) → double - Generates a double number
-
nextInt(
) → int - Generates a 32-bit bit random number
-
nextNumbers(
int length) → Uint32List -
Generate a list of random 32-bit numbers of size
length
-
nextString(
int length, {bool? lower, bool? upper, bool? numeric, bool? controls, bool? punctuations, List< int> ? whitelist, List<int> ? blacklist}) → String -
Generate the next random string of specific
length
. -
nextWord(
) → int - Generates a 16-bit bit random number
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited