Nonce class

A utility class with a single method to generate random alphanumeric strings.

Constructors

Nonce([int length = 32])
Creates a Nonce containing a random alphanumeric string length characters long.
factory
Nonce.key()
Constructs a unique nonce 16 characters in length.
factory
Nonce.secure([int length = 32])
Constructs a Nonce generated with a secure Random that's unique from every other Nonce that's been generated by this global instance.
factory
Nonce.unique([int length = 32])
Constructs a Nonce that's unique from every other Nonce that's been generated by this global instance.
factory

Properties

hashCode int
The hash code for this object.
no setteroverride
length int
Returns the length of this nonce.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
Returns true if other is a Nonce or a String with the same value as this.
override

Static Methods

generate([int length = 32, Random? random]) String
Generates a random alphanumeric string length characters long.