SecureNonce class final
Generates cryptographically secure random nonces.
Uses Random.secure internally.
Constructors
- SecureNonce({Random? random})
- Creates a nonce generator.
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
-
generate(
int length) → String -
Returns a hex string from
lengthrandom bytes. -
generateAlphanumeric(
int length) → String -
Returns an alphanumeric string of exactly
lengthcharacters. -
generateBase64(
int length) → String -
Returns base64-encoded string from
lengthrandom bytes. -
generateBase64Url(
int length) → String -
Returns URL-safe base64 from
lengthrandom bytes. -
generateBytes(
int length) → Uint8List -
Returns
lengthrandom bytes. -
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