title: Python encoded message with HMAC-SHA256
body: <p>I try to encoded message with HMAC-SHA256 in python according to <a href="https://www.bitstamp.net/api/#account-balance" rel="noreferrer">instructions</a></p>
  
  <pre><code>import hmac
  import hashlib
  
  nonce = 1234
  customer_id = 123232
  api_key = 2342342348273482374343434
  API_SECRET = 892374928347928347283473
  
  message = nonce + customer_id + api_key
  signature = hmac.new(
      API_SECRET,
      msg=message,
      digestmod=hashlib.sha256
  ).hexdigest().upper()
  </code></pre>
  
  <p>but I get this</p>
  
  <blockquote>
    <p>Traceback (most recent call last):   File "gen.py", line 13, in
    
        digestmod=hashlib.sha256   File "/usr/lib/python2.7/hmac.py", line 136, in new
        return HMAC(key, msg, digestmod)   File "/usr/lib/python2.7/hmac.py", line 71, in <strong>init</strong>
        if len(key) > blocksize: TypeError: object of type 'long' has no len()</p>
  </blockquote>
  
  <p>Does anyone have any idea why crashes?</p>