def Sha1Hmac(key, text, salt=None):
  if salt:
    salted_text = salt + text
  else:
    salted_text = text

  return hmac.new(key, salted_text, compat.sha1).hexdigest()
Calculates the HMAC-SHA1 digest of a text.
dataset/ETHPy150Open ganeti/ganeti/lib/utils/hash.py/Sha1Hmac