Skip to content

Instantly share code, notes, and snippets.

View kzar's full-sized avatar
🐈
Bashing the rocks together...

Dave Vandyke kzar

🐈
Bashing the rocks together...
View GitHub Profile
@kzar
kzar / fb_helpers.py
Created October 14, 2010 13:34 — forked from droot/fb_helpers.py
Stuff that's missing from the Facebook python SDK
import base64
import hashlib
import hmac
import simplejson as json
def base64_url_decode(inp):
padding_factor = (4 - len(inp) % 4) % 4
inp += "="*padding_factor
return base64.b64decode(unicode(inp).translate(dict(zip(map(ord, u'-_'), u'+/'))))