ObjectId.fromValues constructor

ObjectId.fromValues(
  1. int millisecondsSinceEpoch,
  2. int processUnique,
  3. int counter
)

Creates ObjectId from provided values.

ObjectId structure:

  4 byte timestamp    5 byte process unique   3 byte counter
|<----------------->|<---------------------->|<------------>|
|----|----|----|----|----|----|----|----|----|----|----|----|
0                   4                   8                   12

Implementation

ObjectId.fromValues(
  int millisecondsSinceEpoch,
  int processUnique,
  int counter,
) {
  ArgumentError.checkNotNull(millisecondsSinceEpoch, 'timestamp');
  ArgumentError.checkNotNull(processUnique, 'processUnique');
  ArgumentError.checkNotNull(counter, 'counter');

  _initialize(millisecondsSinceEpoch, processUnique, counter);
}