I have a GUID
which I created with GUID.NewGUID()
. Now I want to replace the first 32 bit of it with a specific 32-bit Integer while keeping the rest as they are.
Is there a function to do this?
You can use ToByteArray()
function and then the Guid constructor.
byte[] buffer = Guid.NewGuid().ToByteArray();
buffer[0] = 0;
buffer[1] = 0;
buffer[2] = 0;
buffer[3] = 0;
Guid guid = new Guid(buffer);
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments