title: node js Buffer Flip Binary Bits
body: <p>I am working on some decoding in nodejs, and have a buffer:</p>
  
  <pre><code>59 19 F2 92  8C 88 88 88  89 88 EB 89  88 88 A1 8A 
  88 88 88 88  89 88 A8 CD  88 88 88 DB  88 88 88 DC 
  88 88 88 A5  88 88 88 BD  88 88 88 B2  88 88 88 B8 
  88 88 88 B8  88 88 88 8A  88 89 89 8D  88 89 8D 8E 
  88 89 89 8F  88 89 89 80  88 8C 87 88  88 88 81 88 
  89 8B 82 88  8C 9C 88 88  88 85 88 8C  88 88 88 88 
  87 88 89 8A  99 88 89 88  9B 88 8C 8D  88 88 88 9C 
  88 8C 8D 88  88 88 9D 88  8C 8D 88 88  88 9E 88 8C 
  A0 88 88 88  9F 88 94 DA  88 88 88 ED  88 88 88 FE 
  88 88 88 ED  88 88 88 FA  88 88 88 FB  88 88 88 ED 
  88 88 88 90  88 90 C4 88  88 88 E1 88  88 88 EF 88 
  88 88 E0 88  88 88 FC 88  88 88 FB 88  88 88 91 88 
  AC C4 88 88  88 ED 88 88  88 EE 88 88  88 FC 88 88 
  88 A8 88 88  88 DC 88 88  88 FD 88 88  88 FA 88 88 
  88 E6 88 88  88 92 88 A0  DA 88 88 88  E1 88 88 88 
  EF 88 88 88  E0 88 88 88  FC 88 88 88  A8 88 88 88
  </code></pre>
  
  <p>The requirement doc says it is encoded XOR the byte against 0x77 then take the complementary byte.</p>
  
  <p>So</p>
  
  <pre><code>59 XOR 77 =&gt; 2E (00101110) =&gt; D1 (11010001)
  19 XOR 77 =&gt; 6E (01101110) =&gt; 91 (10010001)
  </code></pre>
  
  <p>What is the best way in node to do this and end with a buffer with the needed bytes?</p>