SecureRandom class abstract
An abstract base class for reasonably secure Random implementations.
This contains two important static final variables:
- SecureRandom.fast
- A reasonably secure random number generator that can be over 100 times faster than Random.secure.
- SecureRandom.safe
- An instance of Random.secure use by "package:cryptography" implementations by default.
- Implemented types
Constructors
- SecureRandom.constructor()
- Constructor for subclasses.
- SecureRandom.forTesting({int seed = 0})
-
Returns a deterministic Random for testing purposes.
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isSecure → bool
-
Tells whether the algorithm is cryptographically secure and
the initial entropy is from Random.secure.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
nextBool(
) → bool -
Generates a random boolean value.
override
-
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 -
nextUint32(
) → int - Returns a random unsigned 32-bit integer.
-
nextUint52(
[int? max]) → int - Returns a random cross-platform unsigned 52-bit integer.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
reset(
) → void -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- fast → SecureRandom
-
A Random that is over 100 times faster than Random.secure.
final
- safe → Random
-
Random instance that is used as default by "package:cryptography".
final