v1obj method

UuidValue v1obj({
  1. @Deprecated('use config instead. Removal in 5.0.0') Map<String, dynamic>? options,
  2. V1Options? config,
})

Generates a time-based version 1 UUID as a UuidValue object

By default it will generate a string based off current time, and will return it as a UuidValue object.

The first argument is an options map that takes various configuration options detailed in the readme. This is going to be eventually deprecated.

The second argument is a V1Options object that takes the same options as the options map. This is the preferred way to pass options.

http://tools.ietf.org/html/rfc4122.html#section-4.2.2

Example: UuidValue usage

uuidValue = uuid.v1Obj(options: {
    'node': [0x01, 0x23, 0x45, 0x67, 0x89, 0xab],
    'clockSeq': 0x1234,
    'mSecs': new DateTime.utc(2011,11,01).millisecondsSinceEpoch,
    'nSecs': 5678
}) // -> UuidValue{uuid: '710b962e-041c-11e1-9234-0123456789ab'}

print(uuidValue) -> // -> '710b962e-041c-11e1-9234-0123456789ab'
uuidValue.toBytes() -> // -> [...]

Implementation

UuidValue v1obj(
    {@Deprecated('use config instead. Removal in 5.0.0')
    Map<String, dynamic>? options,
    V1Options? config}) {
  return options != null
      ? UuidValue.fromString(v1(options: options))
      : UuidValue.fromString(v1(config: config));
}