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
function base64encode (s) { | |
// from https://gist.github.com/stubbetje/229984 | |
const base64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='.split('') | |
const l = s.length | |
let o = '' | |
for (let i = 0; i < l; i++) { | |
const byte0 = s.charCodeAt(i++) & 0xff | |
const byte1 = s.charCodeAt(i++) & 0xff | |
const byte2 = s.charCodeAt(i) & 0xff | |
o += base64[byte0 >> 2] |
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 requests.packages.urllib3.util import parse_url | |
from urllib.parse import quote, unquote | |
import hashlib | |
import hmac | |
import base64 | |
""" Sign and check a URL using the client_secret """ | |
__author__ = '[email protected], [email protected]' | |