Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /trisongz_lazyops /src /lazyops /libs /compress /gz.py
| """ | |
| GZIP Compress | |
| """ | |
| import gzip | |
| from .base import BaseCompress | |
| from typing import Union | |
| class GzipCompress(BaseCompress): | |
| def compress(cls, data: Union[str, bytes], encoding: str = 'utf-8', **kwargs) -> bytes: | |
| """ | |
| GZip Compress | |
| """ | |
| if isinstance(data, str): data = data.encode(encoding) | |
| return gzip.compress(data) | |
| def decompress(cls, data: Union[str, bytes], encoding: str = 'utf-8', **kwargs) -> bytes: | |
| """ | |
| GZip Decompress | |
| """ | |
| if isinstance(data, str): data = data.encode(encoding = encoding) | |
| return gzip.decompress(data) | |
Xet Storage Details
- Size:
- 652 Bytes
- Xet hash:
- 51af33dc3d36f2cd42296315589bcbc2410a0e092ec6c3a9db42528a45f405d8
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.