title: how to create a sha1 hash in python
body: <p>My objective is to perform "Hashsigning" using smart card in  python. there are hashlib's used but there is no specific SHA1 or SHA256 functions in python. 
  My Work:</p>
  
  <pre><code>hash_object = hashlib.sha1(b'HelWorld')
  pbHash = hash_object.hexdigest()
  </code></pre>
  
  <p>but the length of the hash object I get is 28 rather i should get 14 or 20 so that i can switch on condition as</p>
  
  <pre><code> switch ( dwHashLen )
  {
  case 0x14: // SHA1 hash
               call scard transmit
  case 0x20: // SHA256 hash
  }
  </code></pre>
  
  <p>Any help is appreciated. Thank you in advance</p>