qr-code
Version, currently 1.0.34 versions
- 1.0.3latestJan 4, 2024
- 1.0.2not indexedJul 9, 2026
- 1.0.1not indexedJul 9, 2026
- 1.0.0not indexedJul 9, 2026
github.com/spider-gazelle/qr-code
a QR Code implementation written in crystal lang
24 stars
7 dependents
License: MIT
Installation
# Add this to your shard.yml
dependencies:
qr-code:
github: spider-gazelle/qr-code
version: ~> 1.0.3Then run:
shards installshard.yml
- Crystal
>= 0.36.1
Dependencies
Development Dependencies
- ameba*github: veelenga/amebadev
- stumpy_png*github: stumpycr/stumpy_pngdev
README
Crystal Lang QR Code
Native crystal lang QR code, no external dependencies
Installation
-
Add the dependency to your
shard.yml:dependencies: qr-code: github: spider-gazelle/qr-code -
Run
shards install
Usage
require "qr-code"
qr = QRCode.new("my string to generate", size: 4, level: :h)
puts qr.to_s
output
xxxxxxx x x x x x xx xxxxxxx
x x xxx xxxxxx xxx x x
x xxx x xxxxx x xx x xxx x
... etc
Doing your own rendering
require "qr-code"
qr = QRCode.new("my string to generate", size: 4, level: :h)
qr.modules.each do |row|
row.each do |col|
print col ? '#' : ' '
end
print "\n"
end
Rendering a SVG
require "qr-code"
svg_string = QRCode.new("my string to generate").as_svg
Rendering a PNG
you'll need to add stumpy_png to your shard.yml dependencies
require "qr-code"
require "qr-code/export/png"
# size == width, and QR codes are square
png_bytes = QRCode.new("my string to generate").as_png(size: 256)
Credits
Based off the ruby gem: https://github.com/whomwah/rqrcode_core Which was adapted from the javascript library: https://github.com/kazuhikoarase/qrcode-generator
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
1.0.3- Tagged
- Jan 4, 2024
- Commit
f221da340882- Crystal
>= 0.36.1- Indexed
- yes
Dependents
Repository
github.com/spider-gazelle/qr-code
Metadata
- Created
- Aug 12, 2026
- Updated
- Sep 30, 2026
- Synced
- Sep 29, 2026
- Versions
- 4