Buckets:

download
raw
652 Bytes
"""
ZLib Compress
"""
import zlib
from .base import BaseCompress
from typing import Union
class ZLibCompress(BaseCompress):
@classmethod
def compress(cls, data: Union[str, bytes], encoding: str = 'utf-8', **kwargs) -> bytes:
"""
ZLib Compress
"""
if isinstance(data, str): data = data.encode(encoding)
return zlib.compress(data)
@classmethod
def decompress(cls, data: Union[str, bytes], encoding: str = 'utf-8', **kwargs) -> bytes:
"""
ZLib Decompress
"""
if isinstance(data, str): data = data.encode(encoding = encoding)
return zlib.decompress(data)

Xet Storage Details

Size:
652 Bytes
·
Xet hash:
b45b827c30fdc871fb25e09f998c9ffee6b46bd0413f1f7f8798f611f1eab0b0

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.