title: Converting large integer to 8 byte array in JavaScript
body: <p>I'm trying to convert a large number into an 8 byte array in javascript.</p>
  
  <p>Here is an IMEI that I am passing in: 45035997012373300</p>
  
  <pre><code>var bytes = new Array(7);
  for(var k=0;k&lt;8;k++) {
    bytes[k] = value &amp; (255);
    value = value / 256;
  }
  </code></pre>
  
  <p>This ends up giving the byte array: 48,47,7,44,0,0,160,0. Converted back to a long, the value is 45035997012373296, which is 4 less than the correct value.</p>
  
  <p>Any idea why this is and how I can fix it to serialize into the correct bytes?</p>