Skip to content

Instantly share code, notes, and snippets.

View tcitry's full-sized avatar
🚀
侦测到在途的聚变打击

Dongliang Yin tcitry

🚀
侦测到在途的聚变打击
View GitHub Profile
@tcitry
tcitry / crypto.py
Created March 14, 2019 16:40
python cryptography AES-256-ECB
import base64
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
from cryptography.hazmat.primitives import padding
from cryptography.hazmat.backends import default_backend
from django.utils.encoding import force_bytes, force_text
SECRET_KEY = "hellomotherfucker"
value = force_bytes("12345678901234567890")
backend = default_backend()
@tcitry
tcitry / asyn.py
Created July 26, 2018 09:35
asyncio example
import asyncio
@asyncio.coroutine
def hello():
print("hello start")
ret = yield from asyncio.sleep(2)
print('hello end')
@asyncio.coroutine
def world():
# -*- coding:utf-8 -*-
import io
import re
class Counter:
def __init__(self, path):
"""
:param path: 文件路径
"""
self.mapping = dict()