title: Converting an Array of Hexadecimal Strings to Numbers
body: <p>I have an application in which a server is sending a lot of data every second to clients that request it.  In this data set are several (large) arrays that contain numbers (in some cases 16-bit integers and in others double precision floats).  In order to reduce the packet size, I would like to send only the number of bytes that are necessary to represent the number (2 bytes for the 16 bit and 8 for the 64 bit).  I know that I can do something like this:</p>
  
  <pre><code>/* Create space for 4 32 bit numbers */
  var buffer = new ArrayBuffer(16);
  
  /* Hex representation of [0, 123, 246, 369] */
  buffer = ["0x0", 0x7B", "0xF6", "0x171"];
  
  /* Actual array containing numbers above */
  var int32View = new Int32Array(buffer); 
  </code></pre>
  
  <p>but....I don't want to prepend everything sting with "0x" (adding two bytes will double the size of the 16 bit numbers).  I think I might be missing something - is there a better way to do this such that I don't need to indicate that the strings are hexadecimal representations of numbers (i.e. can I drop the "0x")?</p>
  
  <p>Thanks, Matt</p>