Buckets:

alucchi's picture
download
raw
565 Bytes
#!/usr/bin/env python3
import json, subprocess, sys
from pathlib import Path
inp = Path(sys.argv[1]) if len(sys.argv) > 1 else Path('archive.xz')
out = Path(sys.argv[2]) if len(sys.argv) > 2 else Path('enwik8.out')
pp = inp.parent / 'tmp.preprocessed.bin'
subprocess.run(['xz','-d','-c',str(inp)], check=True, stdout=pp.open('wb'))
subs = json.loads((Path(__file__).with_name('subs.json')).read_text())
data = pp.read_bytes()
for code, pat_hex in subs:
data = data.replace(bytes([code]), bytes.fromhex(pat_hex))
out.write_bytes(data)
pp.unlink(missing_ok=True)

Xet Storage Details

Size:
565 Bytes
·
Xet hash:
a95be4e17b7ea143d8717ba7b4fc85c108fdfb4f2c9ca9b8f4fd928fdf46b227

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