Flake128 constructor

Flake128({
  1. required int machineId,
  2. TimestampSource time = _currentMicros,
  3. bool continuousSequence = false,
})

Create a Flake128 instance.

Implementation

Flake128({
  required this.machineId,
  TimestampSource time = _currentMicros,
  bool continuousSequence = false,
})  : _tracker = new _Tracker(time, 16, continuousSequence),
      _machineIdHex = machineId.toRadixString(16).padLeft(12, '0') {
  if (this.machineId < 0 || this.machineId > (1 << 48) - 1)
    throw new StateError('Machine ID out of bounds.');
}