{"id":28389326,"url":"https://github.com/jozzdart/shrink","last_synced_at":"2026-01-11T04:44:57.046Z","repository":{"id":286843052,"uuid":"960921544","full_name":"jozzdart/shrink","owner":"jozzdart","description":"Effortless, one-line compression. Just call shrink and save 5x-40x in size. Optimized for Firebase, JSON, structured data, or anything you want to shrink!","archived":false,"fork":false,"pushed_at":"2025-05-25T07:49:31.000Z","size":507,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-25T08:29:02.749Z","etag":null,"topics":["compress","compression","dart","easy","firebase","firestore","flutter","no-setup","simple","zlib"],"latest_commit_sha":null,"homepage":"https://pub.dev/packages/shrink","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jozzdart.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-05T11:06:12.000Z","updated_at":"2025-05-25T07:49:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"1c1dc596-e580-4dbf-a0f5-f7e60184ff17","html_url":"https://github.com/jozzdart/shrink","commit_stats":null,"previous_names":["jozzzzep/shrink","jozztech/shrink","jozzdart/shrink"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/jozzdart/shrink","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jozzdart%2Fshrink","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jozzdart%2Fshrink/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jozzdart%2Fshrink/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jozzdart%2Fshrink/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jozzdart","download_url":"https://codeload.github.com/jozzdart/shrink/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jozzdart%2Fshrink/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262201653,"owners_count":23274342,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["compress","compression","dart","easy","firebase","firestore","flutter","no-setup","simple","zlib"],"created_at":"2025-05-31T00:38:33.407Z","updated_at":"2026-01-11T04:44:57.019Z","avatar_url":"https://github.com/jozzdart.png","language":"Dart","funding_links":["https://buymeacoffee.com/yosefd99v"],"categories":[],"sub_categories":[],"readme":"![img](https://i.imgur.com/96jsfqo.png)\n\n\u003ch3 align=\"center\"\u003e\u003ci\u003eBecause every byte counts.\u003c/i\u003e\u003c/h3\u003e\n\u003cp align=\"center\"\u003e\n        \u003cimg src=\"https://img.shields.io/codefactor/grade/github/jozzdart/shrink/main?style=flat-square\"\u003e\n        \u003cimg src=\"https://img.shields.io/github/license/jozzdart/shrink?style=flat-square\"\u003e\n        \u003cimg src=\"https://img.shields.io/pub/points/shrink?style=flat-square\"\u003e\n        \u003cimg src=\"https://img.shields.io/pub/v/shrink?style=flat-square\"\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://buymeacoffee.com/yosefd99v\" target=\"https://buymeacoffee.com/yosefd99v\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Buy%20me%20a%20coffee-Support (:-blue?logo=buymeacoffee\u0026style=flat-square\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\nCompress any data in one line — no setup, no boilerplate, and nothing to configure. It automatically detects if compression is beneficial, chooses the most efficient method, and keeps everything fully lossless. Typical savings range from 5× to 40×, and can reach 1,000× or more with structured data. Ideal for reducing size in Firebase, speeding up local storage, and optimizing for low-bandwidth environments.\n\n- [Introduction](#-shrink-anything-in-one-line)\n- [What can I shrink?!](#what-can-i-shrink)\n- [All functions per data](#-extension-api-shrink--restorex)\n- [Benchmarks](#-benchmarks)\n- [How It Works Under the Hood](#-how-it-works-under-the-hood)\n- [Testing \u0026 Validation](#-testing--validation)\n- [Firebase Integration Example](#-firebase-integration-example)\n- [Beginner's Guide: Step-by-Step Setup \u0026 Usage](#-beginners-guide-step-by-step-setup--usage)\n- [Roadmap \u0026 Future Plans](#-roadmap--future-plans)\n\n---\n\n### ✨ Shrink Anything in One Line\n\nCompression is as easy as calling `.shrink()` on your data — no setup, no boilerplate.\n\n```dart\nfinal compressed = data.shrink(); // ⬇️ Compress your data\n```\n\nOr use the static `Shrink` class for clarity:\n\n```dart\nfinal compressed = Shrink.json(data);\n```\n\n\u003e Works with: `String`, `Map\u003cString, dynamic\u003e`, `Uint8List`, and `List\u003cint\u003e` (unique IDs)\n\n---\n\n### 🔓 Restore Instantly\n\nTo get your original data back, just call `.restoreX()` on the compressed value:\n\n```dart\nfinal restored = compressed.restoreJson(); // ⬆️ Restore original content\n```\n\nOr use the static `Restore` class:\n\n```dart\nfinal restored = Restore.json(compressed);\n```\n\n\u003e Every `shrink` operation is **lossless** — the restored value is identical to the original.\n\n# What Can I Shrink?!\n\n\u003e Real-world data — from network packets to text content — is rarely random. It contains patterns and structure that enable efficient compression. In typical use, shrink reduces data size by 5× to 10×. With highly structured data, compression can reach 100× or even 1,000× smaller. For example, a 1MB list of sequential IDs can shrink to just a few bytes.\n\n#### 🔢 `List\u003cint\u003e` (Unique Integers)\n\n- Perfect for ID lists like inventory items, selected flags, indexes, or any sparse/sequential keys. Optimized for sets of non-repeating integers.\n\n#### 🧠 `Uint8List` (Raw Bytes)\n\n- Great for custom compression workflows — convert anything to bytes and shrink it efficiently. Ideal for binary data or serialized formats.\n\n#### ✍️ `String` (Text)\n\n- Compress plain text directly and restore it back as a String. Works well for logs, messages, descriptions, or long content fields.\n\n#### 📦 `Map\u003cString, dynamic\u003e` (JSON)\n\n- Shrinks any Map\u003cString, dynamic\u003e by compressing the serialized string. Especially useful for structured or repetitive data — great for Firebase, config files, and API payloads.\n\n---\n\n- Shrink any supported data using the extension or static API.\n- Don’t shrink twice — it just adds a byte.\n- Use the correct restore method for the data type.\n\n### ✅ Extension API (`.shrink()` → `.restoreX()`)\n\n| Data Type         | Shrink           | Restore                    |\n| ----------------- | ---------------- | -------------------------- |\n| Unique Integers   | `items.shrink()` | `shrinked.restoreUnique()` |\n| Text (String)     | `text.shrink()`  | `shrinked.restoreText()`   |\n| JSON (Map)        | `data.shrink()`  | `shrinked.restoreJson()`   |\n| Bytes (Uint8List) | `bytes.shrink()` | `shrinked.restoreBytes()`  |\n\n### 🧱 Static API (`Shrink.x()` → `Restore.x()`)\n\n| Data Type         | Shrink                 | Restore                    |\n| ----------------- | ---------------------- | -------------------------- |\n| Unique Integers   | `Shrink.unique(items)` | `Restore.unique(shrinked)` |\n| Text (String)     | `Shrink.text(text)`    | `Restore.text(shrinked)`   |\n| JSON (Map)        | `Shrink.json(data)`    | `Restore.json(shrinked)`   |\n| Bytes (Uint8List) | `Shrink.bytes(bytes)`  | `Restore.bytes(shrinked)`  |\n\n---\n\n### ⬇️ Shrinking in code\n\n```dart\nfinal shrinkedItems = items.shrink();\nfinal shrinkedText  = text.shrink();\nfinal shrinkedJson  = data.shrink();\nfinal shrinkedBytes = data.shrink()\n```\n\nOr use the static `Shrink` class for a clean, explicit API:\n\n```dart\nfinal shrinkedItems = Shrink.unique(items);\nfinal shrinkedText  = Shrink.text(text);\nfinal shrinkedJson  = Shrink.json(data);\nfinal shrinkedBytes = Shrink.bytes(bytes);\n```\n\n### 🔓 Restoring in code\n\nEasily restore compressed data using `.restoreX()`:\n\n```dart\nfinal restoredItems = shrinkedItems.restoreUnique();\nfinal restoredText  = shrinkedText.restoreText();\nfinal restoredJson  = shrinkedJson.restoreJson();\nfinal restoredBytes = shrinkedBytes.restoreBytes();\n```\n\nOr with the static `Restore` class:\n\n```dart\nfinal restoredItems = Restore.unique(shrinkedItems);\nfinal restoredText  = Restore.text(shrinkedText);\nfinal restoredJson  = Restore.json(shrinkedJson);\nfinal restoredBytes = Restore.bytes(shrinkedBytes);\n```\n\n# 📊 Benchmarks\n\n\u003e 🛡 **Built for the long haul.**  \n\u003e When `shrink` gets faster, smaller, and smarter — **you don’t have to lift a finger**.  \n\u003e Every version in the `1.x.x` line is fully **backward compatible**.  \n\u003e Your existing data will always decompress perfectly, no matter how the internals evolve.  \n\u003e Just update and enjoy the gains — **no migrations, no breakage, no surprises**.\n\n`shrink` has been benchmarked with a variety of real-world data scenarios, including:\n\n- Raw bytes: random, repetitive, alternating, zero-filled\n- JSON: flat, nested, arrays, and complex structures\n- Lists of unique integers: sequential, sparse, dense, and special patterns\n\nCompression results vary depending on the input but can reach up to **200,000×** reduction in size. All tests are validated and performance-logged.\n\n### 🧩 Bytes \u0026 Text Shrinking\n\nIn almost every real-world scenario — from network packets and sensor logs to text content and protocol buffers — **data is not truly random**. Even when it _appears_ non-repetitive at a low level, real data almost always contains some form of structure, patterns, or repetition:\n\n- **Character frequency** in text (e.g., spaces, vowels, tags)\n- **Binary signatures** in files and headers\n- **Zero-padded or default values** in structured formats\n- **Protocol overhead** in serialized data\n\nThat’s why compression can be so effective even on data that doesn’t look obviously redundant.\n\nShrink leverages this reality and combines compression strategies to achieve significant reductions for most data types.\n\n---\n\n## 📦 Compression Results (Bytes \u0026 Text)\n\n| Data Pattern      | Input Size (Bytes) | Shrink Size | Space Saved | Factor    |\n| ----------------- | ------------------ | ----------- | ----------- | --------- |\n| Random (1KB)      | 1,000              | 1,001       | `None`      | `No gain` |\n| Repetitive (1KB)  | 1,000              | 27          | **97.3%**   | **37.0×** |\n| Alternating Bytes | 1,000              | 18          | **98.2%**   | **55.6×** |\n| Mostly Zeros      | 1,000              | 73          | **92.7%**   | **13.7×** |\n\n🔍 **Notes:**\n\n- **Large Alternating**: Simulates binary signal streams or periodic sensor toggles (0x00, 0xFF, repeated).\n- **Large Structured (Logs)**: Mimics repetitive log lines like INFO [12:00] Started....\n- **Large Repeated Strings**: Represents large user content with repeated headers, phrases, or template fragments.\n\n\u003e 💡 In Shrink, when compression doesn’t help, it’s intelligently skipped — so there’s no overhead.\n\n## 📄 JSON Shrinking\n\n| Type                  | Original Size | Shrink Size | Space Saved | Factor    |\n| --------------------- | ------------- | ----------- | ----------- | --------- |\n| Simple Flat           | 51            | 52          | `None`      | `No gain` |\n| Deeply Nested \u0026 Small | 85            | 62          | 27.06%      | 1.37×     |\n| Large Array           | 10,901        | 2,033       | 81.35%      | 5.36×     |\n| Repeated Struct.      | 10,591        | 623         | 94.12%      | 17.0×     |\n| Mixed Content         | 1,632         | 403         | 75.31%      | 4.05×     |\n| Large (12101 chars)   | 12,101        | 428         | 96.46%      | 28.27×    |\n| Real-world JSON (40K) | 83,389        | 24,312      | 70.84%      | 3.43×     |\n\n## 🔢 Unique Integer Lists\n\n| Pattern                | Original Size | Shrink Size | Space Saved | Factor   |\n| ---------------------- | ------------- | ----------- | ----------- | -------- |\n| Sequential (1k)        | 4,000         | 4           | 99.90%      | 1000×    |\n| Sparse-Low (1k)        | 4,000         | 630         | 84.25%      | 6.35×    |\n| Sparse-High (1k)       | 4,000         | 1,083       | 72.92%      | 3.69×    |\n| Chunked-Small (1k)     | 4,000         | 360         | 91.00%      | 11.11×   |\n| Chunked-Large (1k)     | 4,000         | 44          | 98.90%      | 90.91×   |\n| Huge Sequential (50k)  | 200,000       | 5           | 100.00%     | 40,000×  |\n| Mega-Sequential (250k) | 1,000,000     | 5           | 100.00%     | 200,000× |\n\n## 🧠 Auto-Selected Compression Examples\n\nShrink automatically selects the best compression strategy based on your data:\n\n| Data Type     | Original Size | Shrink Size | Space Saved | Factor |\n| ------------- | ------------- | ----------- | ----------- | ------ |\n| Mixed IDs     | 4,800         | 14          | 99.71%      | 343×   |\n| Multi-Modal   | 6,000         | 1045        | 82.58%      | 5.74×  |\n| Simulated IDs | 12,000        | 3199        | 73.34%      | 3.75×  |\n\n# 🔬 How It Works Under the Hood\n\nThe `shrink` package is designed for production environments where **data savings**, **ease of use**, and **data integrity** matter most. Under the hood, each supported data type is compressed using a specialized and optimized algorithm, and decompressed using metadata-aware logic. All compression is **lossless**.\n\n### 📦 `Uint8List` (Raw Bytes)\n\nWhen using `Shrink.bytes(...)`, the input is evaluated with multiple algorithms:\n\n- **Identity** (no compression)  \n  Useful when compression would increase the data size.\n\n- **ZLIB** (optimized level between 4–9)  \n  Fast, compact, and widely supported — ideal for structured or repetitive data.\n\nThe smallest result is selected automatically.  \nThe **first byte** of the compressed output encodes the method used, so `Restore.bytes(...)` can safely reverse the process.\n\n---\n\n### 📝 `String` (Text)\n\nStrings are first encoded as UTF-8, then compressed using **Bytes Shrinking**.  \nThis strikes a balance between compression ratio and decoding speed, ideal for text-heavy content.\n\n```dart\nfinal compressed = 'hello world'.shrink();\nfinal original = compressed.restoreText();\n```\n\n---\n\n### 🔧 `Map\u003cString, dynamic\u003e` (JSON)\n\nJSON is compressed in two steps:\n\n1. **Minify** the data with `jsonEncode` (removes unnecessary whitespace).\n2. **Compress** the resulting string with UTF-8 + _Bytes Shrinking_.\n\nThis results in excellent size reductions, especially for structured but repetitive data.\n\n```dart\nfinal compressed = {'name': 'John', 'age': 30}.shrink();\nfinal restored = compressed.restoreJson();\n```\n\n---\n\n### 🔢 `List\u003cint\u003e` (Unique Integers)\n\nFor lists of **unique integers**, `shrink` tries four specialized methods:\n\n- **Delta + Varint Encoding**  \n  Great for sorted lists with small gaps.\n\n- **Run-Length Encoding**  \n  Best when values appear in long consecutive runs.\n\n- **Chunk-Based Encoding**  \n  Suitable for values that form localized clusters.\n\n- **Bitmask Encoding**  \n  Excellent for dense ranges (e.g., 0–1000 with few missing values).\n\nThe algorithm selects the **most space-efficient method** and stores its index in the first byte.\n\nYou can also manually choose the method using `.shrinkManual(...)`, though this is NOT RECOMMENDED since the automatic selection ensures optimal data compression by testing all methods.\n\n```dart\nfinal compressed = [1, 2, 3, 5, 6].shrink();\nfinal restored = compressed.restoreUnique();\n```\n\n# ✅ Testing \u0026 Validation\n\nAll compression and restoration tools in `shrink` are:\n\n- **Heavily tested** for correctness, reversibility, and edge cases.\n- Guaranteed to **preserve exact original content** upon decompression.\n- Validated across many types of real-world and synthetic data.\n- Benchmarked for size reduction and decoding performance.\n\nYou can rely on `shrink` in **production environments** such as:\n\n- Firebase and Firestore data storage\n- Offline cache or local DBs\n- Network transmission over low bandwidth\n- Size-optimized APIs or backups\n\nPerformance and compression algorithms continue to improve with each release — but all `1.x.x` versions of `shrink` maintain **full backward compatibility**. You’ll never need to re-compress or migrate your existing data — it will always restore correctly, regardless of how the internals evolve.\n\n# 🔥 Firebase Integration Example\n\nStoring large lists (like inventory, user items, or flags) in Firestore can get expensive — especially when using arrays of integers. With `shrink`, you can compress the list into a tiny `Blob` field, saving both **space** and **money**, while preserving full data integrity.\n\n### 📥 Saving Compressed Data to Firestore\n\nLet’s say each user has a list of owned item IDs:\n\n```dart\nfinal items = Inventory.getUserItems(); // [1, 2, 3, 5, 8, 13, 21, ...];\n```\n\nYou can shrink this list and store it as a Firestore binary field:\n\n```dart\nimport 'package:cloud_firestore/cloud_firestore.dart';\nimport 'package:shrink/shrink.dart';\n\nfinal userId = 'abc123';\nfinal compressed = items.shrink(); // or Shrink.unique(items)\n\nawait FirebaseFirestore.instance\n  .collection('users')\n  .doc(userId)\n  .set({'items_blob': compressed}, SetOptions(merge: true));\n```\n\n### 📤 Restoring Data from Firestore\n\nWhen you need the original list of items:\n\n```dart\nfinal doc = await FirebaseFirestore.instance\n  .collection('users')\n  .doc(userId)\n  .get();\n\nfinal compressed = doc['items_blob'] as Uint8List;\nfinal restoredItems = compressed.restoreUnique(); // or Restore.unique(compressed)\n```\n\n### 💡 Why Use Shrink?\n\n- ✅ **Drastically smaller payloads** (from KBs to just a few bytes)\n- ✅ **Safe and lossless** — original data is perfectly restored\n- ✅ **Firestore-friendly** — binary blobs are more efficient than large arrays\n- ✅ **Future-proof** — compression method is encoded automatically\n\n\u003e ℹ️ _Tip: You can use this approach for storing compressed JSON, logs, flags, or anything serializable into a list or string._\n\n# 🧑‍🏫 Beginner's Guide: Step-by-Step Setup \u0026 Usage\n\nThis guide walks you through installing and using shrink — a lightweight and powerful tool to compress your data and save space with just one line of code.\n\nYou can shrink text, JSON, byte data, or lists of IDs. It’s great for reducing payloads, speeding up storage, and minimizing Firebase costs.\n\n---\n\n### ✅ Step 1: Add `shrink` to Your Project\n\n#### 🔧 Option A: Use a command (easy \u0026 automatic)\n\nIn your terminal, run one of these:\n\n```bash\nflutter pub add shrink     # if you're using Flutter\n```\n\nor\n\n```bash\ndart pub add shrink        # if you're using Dart only (no Flutter)\n```\n\n#### 📄 Option B: Edit `pubspec.yaml` manually\n\nOpen your `pubspec.yaml` file and add:\n\n```yaml\ndependencies:\n  shrink: ^latest\n```\n\nThen run:\n\n```bash\nflutter pub get    # for Flutter\n```\n\nor\n\n```bash\ndart pub get       # for Dart only\n```\n\nThat’s it! You’ve added `shrink` to your project.  \nNow you're ready to compress and restore data with just a few lines of code.\n\n---\n\n### ✅ Step 2: Import the Package\n\nIn your Dart/Flutter file:\n\n```dart\nimport 'package:shrink/shrink.dart';\n```\n\nThis gives you access to all the `.shrink()` and `.restoreX()` functions.\n\n---\n\n### ✅ Step 3: Shrink Different Types of Data\n\nYou can shrink 4 types of data.  \nEach type has its own example — use the one that matches what you want to compress.\n\n#### 📦 Example 1: Shrink a String (like a message, log, or description)\n\n```dart\nfinal compressed = 'Hello world! This is a long message.'.shrink();\n\n// Later, to get it back:\nfinal restored = compressed.restoreText();\n```\n\n#### 🧠 Example 2: Shrink a JSON object (like user data or settings)\n\n```dart\nfinal compressed = {'name': 'Alice', 'age': 30}.shrink();\n\n// Later:\nfinal restored = compressed.restoreJson();\n```\n\n#### 🔢 Example 3: Shrink a list of IDs (like item IDs, selected indexes)\n\n```dart\nfinal compressed = [1, 2, 3, 5, 8, 13, 21].shrink();\n\n// Later:\nfinal restored = compressed.restoreUnique();\n```\n\n#### 🛠️ Example 4: Shrink custom data (by converting to bytes)\n\n\u003e 🔍 Prefer using .shrink() on String, JSON, or ID lists when possible. Use bytes only for data types that shrink doesn't support directly.\n\n```dart\nfinal custom = {'type': 'note', 'text': 'Welcome!'};\n\n// Convert to bytes (e.g., JSON + UTF-8)\nfinal bytes = Uint8List.fromList(utf8.encode(jsonEncode(custom)));\n\n// Compress the bytes\nfinal compressed = bytes.shrink();\n\n// Later: restore the bytes\nfinal restored = compressed.restoreBytes();\n\n// Convert bytes back to original data\nfinal original = jsonDecode(utf8.decode(restored));\n```\n\n\u003e 💡 Perfect for compressing files, binary blobs, or custom data structures.\n\n---\n\n### ✅ Step 4: Store or Send the Compressed Data\n\nYou can now:\n\n- Save it to a database\n- Send it over a network\n- Store it in memory or a file\n\n**Example: Store it in Firestore**\n\n```dart\nawait FirebaseFirestore.instance\n  .collection('users')\n  .doc('abc123')\n  .set({'profile_blob': compressed});\n```\n\n## ✅ Bonus: Use the Static API Instead (Optional)\n\nIf you prefer something more explicit than `.shrink()`, use:\n\n```dart\nfinal compressedText = Shrink.text('Hello');\nfinal compressedJson = Shrink.json({'a': 1});\nfinal compressedIDs  = Shrink.unique([10, 20, 30]);\nfinal compressedData = Shrink.bytes(Uint8List.fromList([1, 2, 3]));\n```\n\nAnd to restore:\n\n```dart\nfinal original = Restore.text(compressedText);\n```\n\n## 🧪 Complete Example\n\n```dart\nimport 'package:shrink/shrink.dart';\n\nvoid main() {\n  final user = {'id': 1, 'name': 'Bob', 'age': 42};\n\n  final compressed = user.shrink();           // Compress\n  final restored = compressed.restoreJson();  // Restore\n\n  print(restored); // Output: {id: 1, name: Bob, age: 42}\n}\n```\n\n### ℹ️ Good to Know\n\n- ✅ Shrinking is automatic — it picks the best method for your data.\n- ✅ Shrink is **lossless** — you always get the original data back.\n- ✅ If the data can't be compressed, it just returns it as-is (no size increase).\n- ❗ Make sure you use the right `.restoreX()` based on what you compressed.\n\n# 🚀 Roadmap \u0026 Future Plans\n\nThe `shrink` package is actively maintained and will continue to evolve with new features, performance optimizations, and developer-friendly tools. Here's what’s coming next:\n\n### ✅ In Progress\n\n- **Async Compression \u0026 Decompression**\n\n  - Introduce `AsyncShrink` and `AsyncRestore` classes.\n  - Add extension methods: `data.asyncShrink()` and `data.asyncRestore()`.\n  - Benefits:\n    - Non-blocking compression for large payloads.\n    - Ready for use in Flutter apps and backends handling large streams or network data.\n\n- **File Compression Support**\n  - Shrink and restore entire files or file-like streams.\n  - Designed for use with local storage or cloud uploads.\n  - Will include support for:\n    - Reading from `File` or `Stream\u003cList\u003cint\u003e\u003e`.\n    - Writing compressed data directly to disk or Firebase.\n\n### ⚡ Planned Enhancements\n\n- **Improved Performance for JSON \u0026 String Compression**\n\n  - Optimize minification and buffer handling.\n  - Better handling of deeply nested or repetitive JSON structures.\n\n- **Custom Compression Configs**\n\n  - Enable fine-tuned compression strategies.\n  - Allow developers to specify:\n    - Preferred algorithms (e.g., prioritize speed vs. size).\n    - Compression levels or formats (e.g., only use ZLIB).\n\n- **Streamed Compression APIs**\n\n  - Stream in → shrink → stream out.\n  - Ideal for use cases involving:\n    - Real-time logs.\n    - Chunked data uploads/downloads.\n    - Memory-sensitive environments.\n\n### 🔍 Exploratory Ideas\n\n- **Custom Plugin Support**\n\n  - Allow registering your own shrink strategies or codecs.\n\n- **Encrypted Compression Modes**\n\n  - Optional lightweight AES layer over compressed data.\n\n---\n\n## 🔗 License MIT © Jozz\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://buymeacoffee.com/yosefd99v\" target=\"https://buymeacoffee.com/yosefd99v\"\u003e\n    ☕ Enjoying this package? You can support it here.\n  \u003c/a\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjozzdart%2Fshrink","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjozzdart%2Fshrink","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjozzdart%2Fshrink/lists"}