Qrencode.cr
Crystal bindings for libqrencode (qrencode), a library for QR code generation
Install / Use
/learn @woodruffw/Qrencode.crREADME
qrencode.cr
Crystal bindings for libqrencode.
Installation
Add this to your application's shard.yml:
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
Usage
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.
Contributing
- Fork it (https://github.com/woodruffw/qrencode/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- woodruffw William Woodruff - creator, maintainer
Related Skills
node-connect
351.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
110.7kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
351.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
351.4kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
