@staticmethod
def jwt(request, secret, algorithm=hashlib.sha256, alg='HS256'):
    header = Exchange.encode(Exchange.json({'alg': alg, 'typ': 'JWT'}))
    encodedHeader = Exchange.base64urlencode(header)
    encodedData = Exchange.base64urlencode(Exchange.encode(Exchange.json(request)))
    token = ((encodedHeader + '.') + encodedData)
    hmac = Exchange.hmac(Exchange.encode(token), Exchange.encode(secret), algorithm, 'binary')
    signature = Exchange.base64urlencode(hmac)
    return ((token + '.') + signature)
@staticmethod
def jwt(request, secret, algorithm=hashlib.sha256, alg='HS256'):
    header = Exchange.encode(Exchange.json({'alg': alg, 'typ': 'JWT'}))
    encodedHeader = Exchange.base64urlencode(header)
    encodedData = Exchange.base64urlencode(Exchange.encode(Exchange.json(request)))
    token = ((encodedHeader + '.') + encodedData)
    hmac = Exchange.hmac(Exchange.encode(token), Exchange.encode(secret), algorithm, 'binary')
    signature = Exchange.base64urlencode(hmac)
    return ((token + '.') + signature)