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 struct import unpack | |
from zlib import decompress | |
class BufferStream: | |
def __init__(self, data): | |
self.pos = 0 | |
self.data = data | |
def get(self, amount): | |
result = self.data[self.pos:self.pos+amount] |
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
decodingTable = new Uint8Array(256) | |
for c, i in 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' | |
decodingTable[c.charCodeAt(0)] = i | |
base64decode = (string) -> | |
last = string[string.length-2...string.length] | |
if last == '==' | |
remainder = 2 | |
else if last[1] == '=' | |
remainder = 1 |
NewerOlder