I have GUID Hex, example: ac865c7313e3e347b6c93c9da39ee2c7
I need to bring him to byte[16].
How can I do that?
Guid.ToByteArray() – Not suitable because "-" is taken into account there
I have GUID Hex, example: ac865c7313e3e347b6c93c9da39ee2c7
I need to bring him to byte[16].
How can I do that?
Guid.ToByteArray() – Not suitable because "-" is taken into account there
2
Answers
Do it in two steps,
Parse your hex GUID into Guid
Now Convert into
Byte[]
var bytes = guid.ToByteArray();
Try here
Just insert the dashes in place by doing this:
string guidStringFixed = guidHexString.Insert(20, "-").Insert(16, "-").Insert(12, "-").Insert(8, "-");
Then you can parse string to Guid and convert Guid to byte array