Skip to content

Instantly share code, notes, and snippets.

@JimBobSquarePants
Created November 8, 2018 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save JimBobSquarePants/040c2ceb8cde60ae2432c740da9c8d30 to your computer and use it in GitHub Desktop.
Save JimBobSquarePants/040c2ceb8cde60ae2432c740da9c8d30 to your computer and use it in GitHub Desktop.
Xor combination of two Guids.
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