Created
November 8, 2018 14:10
-
-
Save JimBobSquarePants/040c2ceb8cde60ae2432c740da9c8d30 to your computer and use it in GitHub Desktop.
Xor combination of two Guids.
This file contains hidden or 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 static Guid Xor(Guid a, Guid b) | |
{ | |
unsafe | |
{ | |
Int64* ap = (Int64*)&a; | |
Int64* bp = (Int64*)&b; | |
ap[0] ^= bp[0]; | |
ap[1] ^= bp[1]; | |
return *(Guid*)ap; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment