title: Get the hex of 2's complement for negative numbers
body: <p>I am trying to convert an integer number into an array of byte strings.</p>
  
  <pre><code>def int2Hex():
      hex = '%08x' % 32
      bytes = []
  
      for i in range(0,4):
          bytes.append('0x' + hex[i*2: i*2 + 2])
  
      return bytes[::-1] #return in little endian
  </code></pre>
  
  <p>The above code works for positive numbers: <code>['0x00', '0x00', '0x00', '0x20']</code></p>
  
  <p>but when I use a negative number I'll get something like this: <code>['0x-0', '0x00', '0x00', '0x20']</code></p>
  
  <p>What I want for negative numbers is the 2's complement bytes. I am using python 2.</p>