https://github.com/qifi-dev/qrs
Stream data through multiple series of QR codes
https://github.com/qifi-dev/qrs
qrcode transfer-files
Last synced: 13 days ago
JSON representation
Stream data through multiple series of QR codes
- Host: GitHub
- URL: https://github.com/qifi-dev/qrs
- Owner: qifi-dev
- License: mit
- Created: 2024-10-01T11:01:10.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-08T09:12:54.000Z (9 months ago)
- Last Synced: 2025-12-14T11:52:11.818Z (about 1 month ago)
- Topics: qrcode, transfer-files
- Language: TypeScript
- Homepage: https://qrss.netlify.app/
- Size: 858 KB
- Stars: 1,464
- Watchers: 7
- Forks: 90
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome - qifi-dev/qrs - Stream data through multiple series of QR codes (TypeScript)
- awesome - qifi-dev/qrs - Stream data through multiple series of QR codes (TypeScript)
README
Qrs
Stream data through multiple QRCodes
a bit like this meme:
This project is made possible by all the sponsors supporting my work
You can join them at my sponsors profile:
## Try it
[Live demo](https://qrss.netlify.app/)
## Sub-packages
- [QiFi CLI](./packages/cli) - CLI for streaming QR code file transmission
- [luby-transform](./packages/luby-transform) - Luby Transform encoding and decoding
- [@qifi/generate](./packages/generate) - Stream Generated QR Codes for data transmission
## Knowledge
This situation of streaming QR code data transmission is similar to the "Binary Erasure Channel (BEC)," which is a communication model. In this model, the sender transmits binary data (0 or 1), and the receiver has a certain probability of not receiving some data bits, which are marked as "erased" or "lost." In other words, the receiver knows which bits are lost but does not know their specific values. This model is used to study and design coding techniques that can effectively transmit information even in cases of data loss.
Scientists have already achieved very mature research results on how to efficiently transmit data in BEC, one of which is using "Fountain Codes." Fountain Codes are a type of error-correcting code that can effectively transmit information even in the case of data loss. This project uses Luby Transform coding, which is a type of Fountain Code. The basic principle is to divide the original data into multiple small blocks and then generate an unlimited number of encoded blocks through encoding. The receiver only needs to receive enough encoded blocks (usually slightly more than the original blocks) to reconstruct the original data.
## Demo
## Build & run
**1. Install Dependencies**
You need install [Node.js](https://nodejs.org) first.The project uses `pnpm` as its package manager. First, ensure you have `pnpm` installed:
```bash
npm install -g pnpm
```
Then, install the project dependencies:
```bash
pnpm install
```
**2. Build the Project**
Build the project using the command specified in the `package.json` and `netlify.toml`:
```bash
pnpm run build
```
This will generate the output in the `.output` directory.
Alternatively, if you want to run the development server to test changes:
```bash
pnpm run dev
```
**3. Serve the Project Locally**
if your target environment have `Node.js`, you can copy entire `.output` directory to where you want.You can preview this build using:
```bash
node .output/server/index.mjs
```
if your target environment don't have `Node.js`, you cat just host those static files.
```bash
cd .output/public
python -m http.server
```
You will usually encounter the following errors.
```
Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/plain". Strict MIME type checking is enforced for module scripts per HTML spec.
```
you need a custom web server, Run in the `.output/public` directory:
```python
# python custom_http_server.py
from http.server import SimpleHTTPRequestHandler, HTTPServer
class CustomHandler(SimpleHTTPRequestHandler):
def end_headers(self):
self.extensions_map.update({
".js": "application/javascript",
})
super().end_headers()
ADDR = '0.0.0.0'
PORT = 8000
with HTTPServer((ADDR, PORT), CustomHandler) as httpd:
print(f"Serving on http://{ADDR}:{PORT}")
httpd.serve_forever()
```
## Reference
### Fountain Codes
- [Fountain codes and animated QR](https://divan.dev/posts/fountaincodes/)
- [LT codes -- a design and analysis epiphany](https://youtu.be/C4qi_oJoUrE)
- [gofountain](https://github.com/google/gofountain)
### QR Codes
- [Anthony's QR Toolkit](https://github.com/antfu/qrcode-toolkit)