Guid.fromComponents constructor
Creates a Guid from four integer components.
The first component should be a 32-bit value, the second and third components should be 16-bit values, and the fourth component should be a 64-bit value.
Implementation
factory Guid.fromComponents(int data1, int data2, int data3, int data4) {
assert(data1 <= 0xFFFFFFFF);
assert(data2 <= 0xFFFF);
assert(data3 <= 0xFFFF);
final guid = Uint8List(16);
guid.buffer.asUint32List(0)[0] = data1;
guid.buffer.asUint16List(4)[0] = data2;
guid.buffer.asUint16List(6)[0] = data3;
guid.buffer.asUint64List(8)[0] = data4;
return Guid(UnmodifiableUint8ListView(guid));
}