Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/woodruffw/qrencode.cr
Crystal bindings for libqrencode (qrencode), a library for QR code generation
https://github.com/woodruffw/qrencode.cr
crystal crystal-lang qrcode qrcode-generator
Last synced: 19 days ago
JSON representation
Crystal bindings for libqrencode (qrencode), a library for QR code generation
- Host: GitHub
- URL: https://github.com/woodruffw/qrencode.cr
- Owner: woodruffw
- License: mit
- Created: 2018-04-08T18:04:21.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-07-16T20:50:16.000Z (over 1 year ago)
- Last Synced: 2024-12-19T10:17:30.980Z (20 days ago)
- Topics: crystal, crystal-lang, qrcode, qrcode-generator
- Language: Crystal
- Homepage: https://woodruffw.github.io/qrencode.cr/
- Size: 55.7 KB
- Stars: 29
- Watchers: 4
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
qrencode.cr
===========[![CI](https://github.com/woodruffw/qrencode.cr/actions/workflows/ci.yml/badge.svg)](https://github.com/woodruffw/qrencode.cr/actions/workflows/ci.yml)
Crystal bindings for [libqrencode](https://fukuchi.org/works/qrencode/index.html.en).
## Installation
Add this to your application's `shard.yml`:
```yaml
dependencies:
qrencode:
github: woodruffw/qrencode.cr
branch: master
````libqrencode` is required. On Debian-based systems, it can be installed via:
```bash
$ 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.```crystal
require "qrencode"qr = QRencode::QRcode.new("this is my input string")
qr.version
qr.width
qr.dataqr.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/](examples/) directory.
## Contributing
1. Fork it (https://github.com/woodruffw/qrencode/fork)
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request## Contributors
- [woodruffw](https://github.com/woodruffw) William Woodruff - creator, maintainer