Ejemplo n.º 1
0
def compress(passwords):
    buf = BytesIO()
    gzip_data = gzip.GzipFile(fileobj=buf, mode='wb')
    data = json.dumps(passwords)
    gzip_data.write(data.encode('utf-8'))
    gzip_data.close()
    return buf.getvalue()
Ejemplo n.º 2
0
def compress(passwords):
    buf = BytesIO()
    gzip_data = gzip.GzipFile(fileobj=buf, mode='wb')
    renderer = json_renderer(None)
    data = renderer(passwords, {})
    gzip_data.write(data.encode('utf-8'))
    gzip_data.close()
    return buf.getvalue()
Ejemplo n.º 3
0
def compress(passwords):
    buf = BytesIO()
    gzip_data = gzip.GzipFile(fileobj=buf, mode='wb')
    renderer = json_renderer(None)
    data = renderer(passwords, {})
    gzip_data.write(data.encode('utf-8'))
    gzip_data.close()
    return buf.getvalue()
def get_gzip_data(text):
    buf = BytesIO()
    gzip_data = gzip.GzipFile(fileobj=buf, mode='wb')
    gzip_data.write(text.encode('utf-8'))
    gzip_data.close()
    return buf.getvalue()
Ejemplo n.º 5
0
def get_gzip_data(text):
    buf = BytesIO()
    gzip_data = gzip.GzipFile(fileobj=buf, mode='wb')
    gzip_data.write(text.encode('utf-8'))
    gzip_data.close()
    return buf.getvalue()