QR-Code and BASE64 fun

# install qrencode
apt install qrencode

# use qrencode with image
qrencode -o test.png 'test'

# use qrencode with ImageMagick
echo "test" | qrencode -s 10 -o -| display

# Text to qr to Browser image
echo "test" | qrencode -s 10 -o -| base64
iVBORw0KGgoAAAANSUhEUgAAASIAAAEiAQMAAABncE31AAAABlBMVEUAAAD///+l2Z/ TlP//8i138cAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAEJSURBVGiB7dhBDoQgDIXhJh5gjuTVOZIH
MGGgQGlMJs7Ckszk70IFP1cvQoPkb0pQKBQK9RdKem05p9cpsh9jZkdFqzY4tuKL0if/AhWp UzqsTyUw1EKlf0fPCrVW6fR9jqgHld6aOntW7gUqUNmO3GO62bdRz6lZ/p2bRYWp0QOJ5FTb0dwW
KhFUuPJN6BiWOq9/BypApVe92Mokc4gKVr0bapGc9uUlIVSQ6vuwZjViQi1Qs8byVABqiXKd KR3fouJUC2KcPPhwUOHKTn20HdVOtJ29oZapuTJ93LdRQWr2n2IHcKhYpTebTtL7ol6oQOV2ZPsn
lKKi1V2hUCgU6tfVG4K7L1m35cX0AAAAAElFTkSuQmCC

# url
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASIAAAEiAQAAAAB1xeIbAAABeElEQVR4nO2aS26EMBBEX8dIWXqk OUCOAjfL1eAoc4BIsIxkVFmYz2SySBYhQNxegDBvUWrZ7VKBie9H9/QDCJxyyimnnDo6ZdOooLMK a4Z5ptlVVxFULUnqARhNLUGSpM/U3+sqghqWNR4T1gB5G+ytqzAqfLWdh9DllFO/Rs1tJQoYwOqb 5Zn71X9U9eemptp3ueABICSD0fbVVQKVa7+ucTGMNm2DPXWVQJGtZK2E2nzMBqmNKb/Ioz2q+nNT d7WfL5LUB0nLo9d+E+qu54jhKgMwYoKuCbK9dJVAzT5nuMqICXW2tP/4Nh+4R1V/boo1Opj6fZSo +yCI3nM2pe59Tp1vYyV4d4/5R9SaY+bF311A6kHtrrr+N7X4nMndTLNLu3GPuT0155iSEtKtgu4C 1uysqyRqSo5jQu0aLOyvqwRKLUHWEGSvt2f/drIl9ZhjQuwnk9+9pNnpH1X9uanHHDNnyNltDua1 35Iy/zfKKaeccqoI6gPykb77Lm4sZgAAAABJRU5ErkJggg==

# install python3-qrcode

apt install python3-qrcode

Text to qr image

echo "test" | qr > test.png

Text to qr to base64

echo "test" | qr | base64

Text to qr to Browser image

data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASIAAAEiAQAAAAB1xeIbAAABeElEQVR4nO2aS26EMBBEX8dIWXqk
OUCOAjfL1eAoc4BIsIxkVFmYz2SySBYhQNxegDBvUWrZ7VKBie9H9/QDCJxyyimnnDo6ZdOooLMK
a4Z5ptlVVxFULUnqARhNLUGSpM/U3+sqghqWNR4T1gB5G+ytqzAqfLWdh9DllFO/Rs1tJQoYwOqb
5Zn71X9U9eemptp3ueABICSD0fbVVQKVa7+ucTGMNm2DPXWVQJGtZK2E2nzMBqmNKb/Ioz2q+nNT
d7WfL5LUB0nLo9d+E+qu54jhKgMwYoKuCbK9dJVAzT5nuMqICXW2tP/4Nh+4R1V/boo1Opj6fZSo
+yCI3nM2pe59Tp1vYyV4d4/5R9SaY+bF311A6kHtrrr+N7X4nMndTLNLu3GPuT0155iSEtKtgu4C
1uysqyRqSo5jQu0aLOyvqwRKLUHWEGSvt2f/drIl9ZhjQuwnk9+9pNnpH1X9uanHHDNnyNltDua1
35Iy/zfKKaeccqoI6gPykb77Lm4sZgAAAABJRU5ErkJggg==
apt install zbar-tools
zbarimg /path/to/image

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.