def generate_signature(mac_key, normalized_request_string):
    """Generate a request's MAC given a normalized request string (aka
    a summary of the key elements of the request and the mac key (shared
    secret)."""
    # Add padding to the MAC key if needed
    mac_key += '=' * (len(mac_key) % 4 - 4)

    # Base64 decode the MAC key using URL-safe alphabet
    mac_key = base64.urlsafe_b64decode(mac_key)

    return base64.b64encode(
        hmac.new(mac_key, normalized_request_string, hashlib.sha1).digest())
dataset/ETHPy150Open Points/Loyalty-Commerce-Platform/util/lcp_mac.py/generate_signature/swapped operands of `-`