Skip to content

Instantly share code, notes, and snippets.

@teknoraver
Created August 21, 2015 10:08
Show Gist options
  • Save teknoraver/c27ffac51953682b10f2 to your computer and use it in GitHub Desktop.
Save teknoraver/c27ffac51953682b10f2 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <errno.h>
#include <qrencode.h>
/* gcc -O2 qrc.c -o qrc -lqrencode */
int main(int argc, char *argv[])
{
int i, j;
if(argc < 2)
return 0;
QRcode *qrcode = QRcode_encodeString8bit(argv[1], 0, QR_ECLEVEL_L);
for(i = 0; i < qrcode->width; i++) {
for(j = 0; j < qrcode->width; j++)
printf("%s", qrcode->data[i * qrcode->width + j] & 1 ? "▒▒" : " ");
printf("\n");
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment