def _hmacedString(key, string):
 hash = hmac.HMAC(key, digestmod=sha1)
 if isinstance(string, unicode):
  string = string.encode('utf-8')
 hash.update(string)
 return hash.digest()

def _hmacedString ( key , string ) : hash = hmac . HMAC ( key , digestmod = sha1 ) if isinstance ( string , unicode ) : string = string . encode ( 'utf-8' ) hash . update ( string ) return hash . digest ( )
return the sha-1 hmac hash of the given key and string .