title: How to check the bitmask of result of an xor operation of 2 (or more) values?
body: <p>I have two bit masks:</p>
  
  <pre><code>public static UInt64 Mask0 = 0xFFFFFFFF00000000UL;
  public static UInt64 Mask1 = 0x00000000FFFFFFFFUL;
  </code></pre>
  
  <p>I have a ulong value:</p>
  
  <pre><code>UInt64 value = 0x1089000000054321;
  </code></pre>
  
  <p>Then based on a condition, I xor the value with one of the two bit masks.</p>
  
  <pre><code>if (condition == true)
      value ^= Mask0;
  else
      value ^= Mask1;
  </code></pre>
  
  <p>Now the problem is that the value should be dynamic (unpredictable), and will change dynamically when the code is run. I actually won't know the original value (original value before being xored with the Mask). I just need to precisely check/detect which Mask (Mask0 or Mask1) was xored with the value. Any help will be appreciated.</p>