Add the following code to your project's shard.yml under:
to use in production
- OR -
development_dependencies to use in development
Crystal bindings for libqrencode.
Add this to your application's
dependencies: qrencode: github: woodruffw/qrencode.cr branch: master
libqrencode is required. On Debian-based systems, it can be installed via:
$ sudo apt install libqrencode-dev
QRencode provides methods for generating a QR symbol from various inputs (ASCII/UTF8 text, numerics,
Kanji (shift-JIS), etc).
It does not perform the task of rendering QR symbol data to an image format (e.g., PNG) -- it's up to you (or a client library) to do that.
require "qrencode" qr = QRencode::QRcode.new("this is my input string") qr.version qr.width qr.data qr.each_row do |row| # each row is `width` bytes row.each do |byte| if QRencode::Util.black? byte print "B" else print "W" end end puts end
Check out the examples/ directory.
git checkout -b my-new-feature)
git commit -am 'Add some feature')
git push origin my-new-feature)