Skip to content

Instantly share code, notes, and snippets.

View gustavolopess's full-sized avatar
🌏
Working full-remote

Gustavo Lopes gustavolopess

🌏
Working full-remote
View GitHub Profile
import hmac
import hashlib
import base64
import json
import datetime
secret_key = '52d3f853c19f8b63c0918c126422aa2d99b1aef33ec63d41dea4fadf19406e54'
def create_jwt(payload):
payload = json.dumps(payload).encode()
import hmac
import hashlib
import base64
import json
secret_key = '52d3f853c19f8b63c0918c126422aa2d99b1aef33ec63d41dea4fadf19406e54'
JWT = 'eyJ0eXAiOiAiSldUIiwgImFsZyI6ICJIUzI1NiJ9.eyJ1c2VySWQiOiAiNTUzOTU0MjctMjY1YS00MTY2LWFjOTMtZGE2ODc5ZWRiNTdhIiwgImV4cCI6IDE1NTY4NDE2MDB9.09Rcd_IMo9dDVi0kJGeCpgS-YeTKtUxmMvHO1QnLC5c='
b64_header, b64_payload, b64_signature = JWT.split('.')
b64_signature_checker = base64.urlsafe_b64encode(
import hmac
import hashlib
import base64
import json
secret_key = '52d3f853c19f8b63c0918c126422aa2d99b1aef33ec63d41dea4fadf19406e54'
header = json.dumps({
'typ': 'JWT',
'alg': 'HS256'
header = {
"typ": "JWT",
"alg": "HS256"
}
payload = {
"userId": "55395427-265a-4166-ac93-da6879edb57a",
"exp": 1556841600
}
{
"userId": "55395427-265a-4166-ac93-da6879edb57a",
"exp": 1556841600
}
{
"typ": "JWT",
"alg": "HS256"
}
@gustavolopess
gustavolopess / bees.ipynb
Last active June 6, 2017 11:04
Search method of bees algorithm
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.