@staticmethod
def hmac(request, secret, algorithm=hashlib.sha256, digest='hex'):
    h = hmac.new(secret, request, algorithm)
    if (digest == 'hex'):
        return h.hexdigest()
    elif (digest == 'base64'):
        return base64.b64encode(h.digest())
    return h.digest()
@staticmethod
def hmac(request, secret, algorithm=hashlib.sha256, digest='hex'):
    h = hmac.new(secret, request, algorithm)
    if (digest == 'hex'):
        return h.hexdigest()
    elif (digest == 'base64'):
        return base64.b64encode(h.digest())
    return h.digest()