cold-widow: File transfer via QR Codes.

[ bsd3, library, program, utility ] [ Propose Tags ]

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

[Skip to Readme]




Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Versions [RSS] 0.1.2
Dependencies base (>=4.7 && <5), bytestring, cold-widow [details]
License BSD-3-Clause
Copyright 2016 Mihai Giurgeanu
Author Mihai Giurgeanu
Category Utility
Home page
Uploaded by mihaigiurgeanu at 2016-10-31T21:46:36Z
Distributions NixOS:0.1.2
Executables compact-decode45, decode45, encode45, cold-widow
Downloads 895 total (7 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for cold-widow-0.1.2

[back to package description]


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.


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

Building from source


You will need to download and install stack.

You also need git to get the latest source code.

Get the source

git clone


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


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


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 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.