SecureRandom class

Implemented types
Available extensions

Constructors

SecureRandom.new({bool forceFallbackSecureRandom = false})

Properties

hashCode int
The hash code for this object.
no setterinherited
isFallbackSecureRandom bool
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

advance({int minSteps = 0, int maxSteps = 97, Random? random}) int

Available on Random, provided by the RandomExtension extension

nextBool() bool
Generates a random boolean value.
override
nextBytes(Uint8List bytes, [int? length]) int

Available on Random, provided by the RandomExtension extension

nextDouble() double
Generates a non-negative random floating point value uniformly distributed in the range from 0.0, inclusive, to 1.0, exclusive.
override
nextInt(int max) int
Generates a non-negative random integer uniformly distributed in the range from 0, inclusive, to max, exclusive.
override
nextSeed({int layers = 5}) int

Available on Random, provided by the RandomExtension extension

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
randomBytes(int length) Uint8List

Available on Random, provided by the RandomExtension extension

toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

createPlatformSecureRandom({bool forceFallbackSecureRandom = false}) Random
Tries to return Random.secure(). If not supported by the current platform, returns a fallback (_SecureRandomFallback).
generateSeed() int
Generates a seed to be used to instantiate Random.