This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import base64 | |
import zlib | |
compressed = base64.b64encode(zlib.compress(decompressed)) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import jose | |
from json import dumps | |
from Crypto.PublicKey import RSA | |
key = RSA.generate(2048) | |
private_key = key.exportKey('PEM').decode('utf-8') | |
public_key = key.publickey().exportKey('PEM').decode('utf-8') | |
from jwcrypto import jwk, jwe | |
from jwcrypto.common import json_encode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def fun(a=0, b=0): | |
print(a, b) | |
fun(**{'b': 2}, a=1) # <--- breaks in 3.4 | |
fun(a=1, **{'b': 2}) # works in 3.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from uuid import uuid4 | |
from time import time | |
from datetime import datetime, timedelta | |
import lmdb | |
def get_random(size): | |
def get_bytes(): | |
return bytearray(size) | |
return get_bytes |
OlderNewer