| b64_list = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
|
| def b64_decode(str):
|
| """Takes as input a string and returns an integer value of it decoded
|
| with the base64 algorithm used by dict indexes."""
|
| if not len(str):
|
| return 0
|
| retval = 0
|
| shiftval = 0
|
| for i in range(len(str) - 1, -1, -1):
|
| val = b64_list.index(str[i])
|
| retval = retval | (val << shiftval)
|
| shiftval += 6
|
| return retval
|