import hmac
import hashlib


def get_payload_signature(key, payload):
    """Compute the payload signature given a key."""
    mac = hmac.new(key, msg=payload, digestmod=hashlib.sha1)
    return mac.hexdigest()