title: How can I format an integer to a two digit hex?
body: <p>Does anyone know how to get a chr to hex conversion where the output is always two digits? </p>
  
  <p>for example, if my conversion yields 0x1, I need to convert that to <code>0x01</code>, since I am concatenating a long hex string.</p>
  
  <p>The code that I am using is:</p>
  
  <pre><code>hexStr += hex(ord(byteStr[i]))[2:]
  </code></pre>