MyNixOS website logo
Description

File transfer via QR Codes.

Utilities and Haskell library to transfer files via qr-codes.

cold-widow

Executables and Haskell library to transfer files via QR Codes.

The idea is to generate a list of qr-coedes representing the archived version folder. The qr-codes will be read as text values by any qr-code reader supporting alpahnumeric encoding. The texts can be send via any technology, like email, sms, whatsapp, skype, hangouts, etc to the final destination. At the final destination, you feed these texts to the decoder and get the original file structure.

Installation

The only supported installation method is from source files, stack.

Building from source

Prerequisites

You will need to download and install stack.

You also need git to get the latest source code.

Get the source

git clone https://github.com/mihaigiurgeanu/cold-widow.git

Building

To build the project, you need first to run stack setup. This command will make sure you have the correct haskell compiler, and, if you don't have it, it will download and install one in a separate location in such a way to not interract with your existing haskell environment (if you have one):

#> cd /the/location/of/cold-widow/
#> stack setup

After the setup (you only need to run setup once) you may build, test or install the software. To build, simply issue:

#> stack build

To run the tests:

#> stack test

To install it in the stack's install directory, type:

#> stack install

Usage

The only functions implemented until now are encoding and decoding a file to/from a textual form using only the alphanumeric symbols allowed in a QR Code. This will allow you to read the generated QR Code with any QR Code reader, copy paste the text in an email or whatever transport you choose.

To generate QR Codes you need to use external programs to archive and compress your files, to split the archive in appropriate size to be encoded in the QR Codes. For example:

#> tar cv informic-0.1.0/*.patch | bzip2 -9 | split -b 2900 - informic-0.1.0/x

will archive the files with the extension .patch located in the informic-0.1.0/ folder, will compress the archive using bzpi2 utility, will split the resulting compressed archived in files named xaa, xab, xac, etc. of 2900 bytes each and will put these files into informic-0.1.0/ folder.

To encode those files using cold-widow's encode45 you could use the following:

#> cd informic-0.1.0
#> for i in x*; do encode45 $i > $i.txt; done 

Then you should use a qr-code generator to generate one qr-code for each xaa.txt, xab.txt, xac.txt, etc files generated by the above commands. Scan the qr-codes with you mobile phone and copy-paste the text into a email message that you can send to anyone you want.

Finally, using decode45 you can convert the fragments of text back to the original archive. Copy in the clipboard the text coresponding to first part (the file xaa in the example above) and paste it in a file, for example in the xaa.txt file:

#> decode45 xaa < xaa.txt

This will generate on disk the file named xaa with the same contents of the original xaa file which is a part of the splited compressed archive. After doing this for all file parts, you can use the following to obtain the original files structure:

#> cat x* | bzcat | tar xv

encode45

The encode45 utility will get a file as first argument and will output the encoded text representing the file. The text will contain only characters allowed by the qr-code alphanumeric mode.

To use it as a qr-code, you need to pass a maximum of about 2900 bytes file to the encode45 utility.

decode45

decode45 will read from standard output a text containing only the characters allowed in qr-code alphanumeric mode and will decoded as a binary file. The name of the file to which decode45 will save the binary data must be passed as the first argument of the decode45 method.

Metadata

Version

0.1.2

Executables (4)

Show all
  • bin/encode45
  • bin/decode45
  • bin/compact-decode45
  • bin/cold-widow

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows