Skip to content

Instantly share code, notes, and snippets.

View 73spica's full-sized avatar

Haruka Hoshino 73spica

View GitHub Profile
from urllib.parse import urlencode, quote, quote_plus
import hashlib
import hmac
import base64
from operator import itemgetter
import time
import requests
import os # for nonce
from sage.all import *
# ======== Extended Euclidean algorithm ========
def egcd(a, b):
if a == 0:
return (b, 0, 1)
else:
g, y, x = egcd(b % a, a)
return (g, x - (int(b / a)) * y, y)