in rocketmq-client-csharp/MessageIdGenerator.cs [40:68]
private MessageIdGenerator()
{
MemoryStream stream = new MemoryStream();
BinaryWriter writer = new BinaryWriter(stream);
var macAddress = Utilities.GetMacAddress();
writer.Write(macAddress, 0, 6);
int processId = Utilities.GetProcessId();
byte[] processIdBytes = BitConverter.GetBytes(processId);
if (BitConverter.IsLittleEndian)
{
Array.Reverse(processIdBytes);
}
writer.Write(processIdBytes, 2, 2);
var array = stream.ToArray();
_prefix = version + Utilities.ByteArrayToHexString(array);
DateTime epoch = new DateTime(2021, 1, 1,
0, 0, 0, 0, DateTimeKind.Utc);
var now = DateTime.Now;
_secondsSinceCustomEpoch = Convert.ToInt64(now.ToUniversalTime().Subtract(epoch).TotalSeconds);
_stopwatch = Stopwatch.StartNew();
_sequence = 0;
}