title: Is there a better way than int( byte_buffer.encode('hex'), 16 )
body: <p>In Python, I'm constantly using the following sequence to get an integer value from a byte buffer (in python this is a str).</p>
  
  <p>I'm getting the buffer from the struct.unpack() routine.  When I unpack a 'char' using</p>
  
  <pre><code>byte_buffer, = struct.unpack('c', raw_buffer)
  int_value = int( byte_buffer.encode('hex'), 16 )
  </code></pre>
  
  <p>Is there a better way?  </p>