A free, open-source web application for compressing and decompressing files directly in your web browser using the Zeckendorf representation algorithm. All processing happens locally in your browser—no data is uploaded to any server. This compression tool uses Rust based WebAssembly for high-performance, client-side file compression and decompression.
The Zeckendorf algorithm represents numbers as a sum of non-consecutive Fibonacci numbers. This webapp interprets your file data as a big integer (either big-endian or little-endian), converts it to its Zeckendorf representation, and can achieve compression for certain types of data. The application automatically tries both endian interpretations and selects the one that produces the best compression.
Note: Compression is not guaranteed—the algorithm may result in a larger representation depending on the input data. The effectiveness varies by input type and size.
- Browser-Based Compression: All processing happens locally in your browser using WebAssembly
- No Data Upload: Your files never leave your device
- Multiple Endian Interpretations: Automatically tries both big-endian and little-endian interpretations
- Automatic Best Compression: Selects the best compression result automatically
- Progressive Web App (PWA): Works offline and can be installed on your device
- Modern UI: Built with React and Tailwind CSS
Every positive integer can be uniquely represented as a sum of non-consecutive Fibonacci numbers. For example:
- 12 = 8 + 3 + 1 = F(6) + F(4) + F(2)
- Your file data is interpreted as either a big-endian or little-endian integer
- The integer is converted to its Zeckendorf representation (list of Fibonacci indices)
- The representation is encoded as bits (use/skip bits)
- Bits are packed into bytes
The webapp automatically tries both endian interpretations and selects the one that produces the smallest output.
This project is built with:
- Vite - Build tool and dev server
- TypeScript - Type-safe JavaScript
- React - UI framework
- shadcn-ui - UI components
- Tailwind CSS - Styling
- WebAssembly (WASM) - High-performance compression engine
- Zeckendorf Rust Library - Core compression algorithm (compiled to WASM)
The compression engine is powered by the Zeckendorf Rust library, compiled to WebAssembly for browser execution.
- Node.js (v20 or higher) - install with nvm
- pnpm (v9.12.0) - Package manager
- Rust - For building the WebAssembly module
- wasm-pack - For compiling Rust to WebAssembly
# Step 1: Clone the repository
git clone git@github.com:pRizz/zeckendorf-webapp.git
cd zeckendorf-webapp
# Step 2: Initialize git submodules (required for the Zeckendorf library)
git submodule update --init --recursive
# Step 3: Install dependencies
pnpm install
# Step 4: Build the WebAssembly module
pnpm run build-zeckendorf-rs-wasm
# Step 5: Start the development server
pnpm run devThe development server will start at http://localhost:8080
pnpm run dev- Start development server (builds WASM first)pnpm run build- Build for productionpnpm run build-zeckendorf-rs-wasm- Build the WebAssembly modulepnpm run preview- Preview production buildpnpm run lint- Run ESLintpnpm run lint:fix- Fix ESLint issues
This project is configured to automatically deploy to GitHub Pages when you push to the main branch. The deployment workflow:
- Builds the Rust WebAssembly module
- Builds the Vite application
- Deploys to GitHub Pages
To enable GitHub Pages:
- Go to your repository Settings → Pages
- Select "GitHub Actions" as the source
- The workflow will automatically deploy on pushes to
main
The app is configured with the base path /zeckendorf-webapp/ for GitHub Pages deployment.
- Compression Not Guaranteed: Some inputs may result in larger output
- Compression Effectiveness: Decreases as input size increases
- Browser Support: Requires a modern browser with WebAssembly support
- Single File Processing: Only one file can be processed at a time. Attempting to process multiple files will show a warning dialog
- File Size Warning: Files larger than 10KB may cause high CPU usage, memory issues, or browser tab lockup. A warning dialog will be shown before processing files larger than this threshold, allowing you to proceed or cancel
This project is open source and free to use. The Zeckendorf compression library is licensed under the MIT License.
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- Zeckendorf's Theorem - Every positive integer has a unique representation as a sum of non-consecutive Fibonacci numbers
- Zeckendorf Rust Library - The underlying compression library