Uuid constructor Null safety
- {GlobalOptions? goptions}
Creates a new instance of the Uuid class. Optionally you can pass in a GlobalOptions object to set global options for all UUID generation. GlobalOptions.rng is a function that returns a list of random bytes. GlobalOptions.positionalArgs is a list of positional arguments to pass to the RNG function. GlobalOptions.namedArgs is a map of named arguments to pass to the RNG function.
Defaults rng function is UuidUtil.mathRNG
Example: Using CryptoRNG globally
var uuid = Uuid(options: {
'grng': UuidUtil.cryptoRNG
})
// Generate a v4 (random) id that will use cryptRNG for its rng function
uuid.v4();
Implementation
const Uuid({this.goptions});