title: Ultra Quick Way To Concatenate Byte Values
body: <p>Given 3 different bytes such as say x = 64, y = 90, z = 240 I am looking to concatenate them into say a string like 6490240. It would be lovely if this worked but it doesn't:</p>
  
  <pre><code> string xx = (string)x + (string)y + (string)z;
  </code></pre>
  
  <p>I am working in C++, and would settle for a concatenation of the bytes as a 24 bit string using their 8-bit representations. </p>
  
  <p>It needs to be ultra fast because I am using this method on a lot of data, and it seems frustratingly like their isn't a way to just say treat this byte as if it were a string.</p>
  
  <p>Many thanks for your help</p>
  
  <p>To clarify, the reason why I'm particular about using 3 bytes is because the original data pertains to RGB values which are read via pointers and are stored of course as bytes in memory.</p>
  
  <p>I want a way really to treat each color independently so you can think of this as a hashing function if you like. So any fast representation that does it without collisions is desired. This is the only way I can think of to avoid any collisions at all.</p>