From 6a1b6f052edb3efd1c281e208f2bb6d5a929e412 Mon Sep 17 00:00:00 2001 From: Krishna200608 Date: Wed, 31 Dec 2025 15:12:45 +0530 Subject: [PATCH 1/2] Implement Zlib compression for object storage --- src/data.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/data.py b/src/data.py index ba68ab9..c36c8fb 100644 --- a/src/data.py +++ b/src/data.py @@ -1,5 +1,6 @@ import os import hashlib +import zlib DING_DIR = ".ding" @@ -65,6 +66,10 @@ def hash_objects(args): oid = hashlib.sha256(content).hexdigest() print(oid) + + # Compress the content using zlib before writing to disk + compressed_content = zlib.compress(content) + object_file_path = os.path.join(objects_path, oid) with open(object_file_path, "wb") as f: - f.write(content) + f.write(compressed_content) \ No newline at end of file From 59686f7c8e399bbef2b22126ee78bd065e1b7bef Mon Sep 17 00:00:00 2001 From: Aryan Pandey <156807533+Rational-Idiot@users.noreply.github.com> Date: Sat, 3 Jan 2026 15:34:40 +0530 Subject: [PATCH 2/2] Revert changes to make pr empty --- src/data.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/data.py b/src/data.py index c36c8fb..ba68ab9 100644 --- a/src/data.py +++ b/src/data.py @@ -1,6 +1,5 @@ import os import hashlib -import zlib DING_DIR = ".ding" @@ -66,10 +65,6 @@ def hash_objects(args): oid = hashlib.sha256(content).hexdigest() print(oid) - - # Compress the content using zlib before writing to disk - compressed_content = zlib.compress(content) - object_file_path = os.path.join(objects_path, oid) with open(object_file_path, "wb") as f: - f.write(compressed_content) \ No newline at end of file + f.write(content)