Last active
August 1, 2018 05:49
-
-
Save johnta0/1e09170210661bd0ac8f07f8609bd6ae to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env python | |
# -*- coding:utf-8 -*- | |
import hmac | |
import hashlib | |
import urllib.parse | |
import xerox | |
# URLの入力を受け取る | |
url = str(input('Input the original URI:')) | |
# ハッシュ計算(keyは受け取るだけ) | |
digest = hmac.new('0x24FEEDFACEDEADBEEFCAFE'.encode('utf-8'), msg=url.encode('utf-8'), digestmod=hashlib.sha1).hexdigest() | |
proxy_url = 'http://localhost:8081/' + digest + '?url=' + url | |
print("urlはクリップボードにコピーされました") | |
print(proxy_url) | |
xerox.copy(proxy_url) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment