clockSequence property

int get clockSequence

Gets the clock sequence from a time-based UUID (version 1).

Returns:

  • Clock sequence value (14 bits)
  • Throws UnsupportedError if not a version 1 UUID

The clock sequence is used to handle cases where the system clock is adjusted backwards or the UUID generator is restarted.

Implementation

int get clockSequence {
  if (version != 1) {
    throw UnsupportedError('Clock sequence is only available for version 1 UUIDs');
  }

  return ((_leastSigBits >> 48) & BigInteger.fromInt(0x3FFF)).toInt();
}