title: Convert std::string to uint16_t*
body: <p>I have serialized some data into an ostream to be send over a devicefile., in binary format.</p>
  
  <p>I am getting output like this when printing the contents of ostream which is fine.</p>
  
  <p>Now I need to calculate the checksum using a certain algorithm :</p>
  
  <p>Since I am using filestreams , I have the binary data in string format :</p>
  
  <p>eg :</p>
  
  <p>46774101101140410MyMakeMyModel10000....</p>
  
  <p>I would like to compute checksum using the algorithm ..</p>
  
  <p>which goes like </p>
  
  <p>The checksum is calculated by 2's compliment addition of all 16 bit words</p>
  
  <p>In case of odd no of octets the final octet assumed as 16 bit 0s padded in MSB .</p>
  
  <p>I am looking into solutions please suggest a fool proof method input is a string or a char *</p>
  
  <p>Thanks</p>