Created
May 23, 2024 08:34
-
-
Save SMoni/d2c680ee1180365f2b8bc399e9e239c6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public Guid combineThose(Guid[] IDs_) { | |
const int length = 16; | |
return IDs_.Aggregate(Guid.Empty, (Accumulate, Current) => { | |
var result = new byte[length]; | |
var asByteArrayAccumulate = Accumulate.ToByteArray(); | |
var asByteArrayCurrent = Current.ToByteArray(); | |
for (var index = 0; index < length; index++) { | |
var byteDate = asByteArrayAccumulate[index]; | |
var byteID = asByteArrayCurrent [index]; | |
var byteSurrogate = (byte)(byteID ^ byteDate); | |
result.SetValue(byteSurrogate, index); | |
} | |
return new Guid(result); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment