All Projects → whomwah → rqrcode_core

whomwah / rqrcode_core

Licence: MIT License
A Ruby QRCode encoding library

Programming Languages

ruby
36898 projects - #4 most used programming language
shell
77523 projects

Labels

Projects that are alternatives of or similar to rqrcode core

qr-code-unity-3d-read-generate
Generating a QR code / Scanning a QR code in Unity 3D. Pre-build DLL and sample code from old Unity
Stars: ✭ 70 (+105.88%)
Mutual labels:  qrcode
react-native-qr-scanner
一个二维码扫描组件,依赖react-native-camera
Stars: ✭ 111 (+226.47%)
Mutual labels:  qrcode
qrcode-with-logos
A plugin for creating a qrcode with logo, Demo
Stars: ✭ 61 (+79.41%)
Mutual labels:  qrcode
gn-api-sdk-node
SDK em NodeJS integrada a API Gerencianet. Esta SDK está preparada para integração à API Pix e API Boletos da Gerencianet, que lhe permite realizar o gerenciamento de cobranças Pix com QR Code e Pix Copia e Cola, boleto/Bolix, carnê, cartão de crédito e muito mais.
Stars: ✭ 33 (-2.94%)
Mutual labels:  qrcode
koder
QR/bar code scanner for the Browser
Stars: ✭ 73 (+114.71%)
Mutual labels:  qrcode
simple-login-qrcode-webcam-php
🐱‍💻 Just simple login mechanism using QR Code Scanner with Webcam in PHP
Stars: ✭ 66 (+94.12%)
Mutual labels:  qrcode
Xam.Forms.QRCode
A QRCode renderer based on SkiaSharp.
Stars: ✭ 16 (-52.94%)
Mutual labels:  qrcode
ZATCA
An unofficial package maintained by Salla to help developers to implement ZATCA (Fatoora) QR code easily which required for e-invoicing
Stars: ✭ 77 (+126.47%)
Mutual labels:  qrcode
homekit-qrcode
Generate a pairing HomeKit QR code label for your HomeKit accessory from the command line
Stars: ✭ 17 (-50%)
Mutual labels:  qrcode
qr
🔲 Generate QR Codes straight in your terminal!
Stars: ✭ 34 (+0%)
Mutual labels:  qrcode
AusweisBot
Telegram bot to generate self-authorizations for moving around during covid-19 pandemic in France
Stars: ✭ 13 (-61.76%)
Mutual labels:  qrcode
react-native-qrcode-scanner
A highly customizable QR code scanning component for React Native
Stars: ✭ 12 (-64.71%)
Mutual labels:  qrcode
qrcode
A flutter plugin for scanning QR codes. Use AVCaptureSession in iOS and zxing in Android.
Stars: ✭ 69 (+102.94%)
Mutual labels:  qrcode
r scan
📷🖨Flutter二维码&条形码扫描插件,支持相机、文件、链接、Uint8List类型扫描
Stars: ✭ 108 (+217.65%)
Mutual labels:  qrcode
garden.zbarcam
Migrated to https://github.com/kivy-garden/zbarcam
Stars: ✭ 49 (+44.12%)
Mutual labels:  qrcode
pix-payload-generator.net
Gerar payload para qrcode estático PIX. (Sistema de pagamento instantâneo do Brasil) Sem a necessidade de conexão com um PSP.
Stars: ✭ 23 (-32.35%)
Mutual labels:  qrcode
QRManager
This is an example that uses ZXing.Net.Mobile for Forms. See more information here:
Stars: ✭ 19 (-44.12%)
Mutual labels:  qrcode
qrencode.cr
Crystal bindings for libqrencode (qrencode), a library for QR code generation
Stars: ✭ 28 (-17.65%)
Mutual labels:  qrcode
covidpass
Scan your vaccination, test and recovery certificates in QR code representation and save them to your Apple Wallet
Stars: ✭ 137 (+302.94%)
Mutual labels:  qrcode
QR Attendance
This project is an attendance system which provides attendance on scanning QR code. The attendance is stored in Excel sheet named with the date of attendance taken. In this folder a file named Generate.py is used to generate the QR code for given input file. Attend.py file is for scanning the QR code
Stars: ✭ 17 (-50%)
Mutual labels:  qrcode

Ruby Style Guide

RQRCodeCore

rqrcode_core is a library for encoding QR Codes in pure Ruby. It has a simple interface with all the standard qrcode options. It was originally adapted in 2008 from a Javascript library by Kazuhiko Arase.

Features:

  • rqrcode_core is a Ruby only library. It requires no 3rd party libraries. Just Ruby!
  • It is an encoding library. You can't decode QR Codes with it.
  • The interface is simple and assumes you just want to encode a string into a QR Code, but also allows for encoding multiple segments.
  • QR Code is trademarked by Denso Wave inc.

rqrcode_core is the basis of the popular rqrcode gem [https://github.com/whomwah/rqrcode]. This gem allows you to generate different renderings of your QR Code, including png, svg and ansi.

Installation

Add this line to your application's Gemfile:

gem "rqrcode_core"

And then execute:

$ bundle

Or install it yourself as:

$ gem install rqrcode_core

Basic Usage

$ require "rqrcode_core"
$ qr = RQRCodeCore::QRCode.new("https://kyan.com")
$ 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

Multiple Encoding Support

$ require "rqrcode_core"
$ qr = RQRCodeCore::QRCode.new([{data: "byteencoded", mode: :byte_8bit}, {data: "A1" * 100, mode: :alphanumeric}, {data: "1" * 500, mode: :number}])

This will create a QR Code with byte encoded, alphanumeric and number segments. Any combination of encodings/segments will work provided it fits within size limits.

Doing your own rendering

require "rqrcode_core"

qr = RQRCodeCore::QRCode.new("https://kyan.com")
qr.rows.each do |row|
  row.each do |col|
    print col ? "#" : " "
  end

  print "\n"
end

Options

The library expects a string or array (for multiple encodings) to be parsed in, other args are optional.

data - the string or array you wish to encode

size - the size (integer) of the QR Code (defaults to smallest size needed to encode the string)

max_size - the max_size (Integer) of the QR Code (default RQRCodeCore::QRUtil.max_size)

level  - the error correction level, can be:
  * Level :l 7%  of code can be restored
  * Level :m 15% of code can be restored
  * Level :q 25% of code can be restored
  * Level :h 30% of code can be restored (default :h)

mode - the mode of the QR Code (defaults to alphanumeric or byte_8bit, depending on the input data, only used when data is a string):
  * :number
  * :alphanumeric
  * :byte_8bit
  * :kanji

Example

RQRCodeCore::QRCode.new("http://kyan.com", size: 1, level: :m, mode: :alphanumeric)

Development

Tests

You can run the test suite using:

$ ./bin/setup
$ rake

or try the project from the console with:

$ ./bin/console

Linting

The project uses standardrb and can be run with:

$ ./bin/setup
$ rake standard # check
$ rake standard:fix # fix

Experimental

On 64 bit systems when generating lots of QR Codes the lib will consume more memory than on a 32 bit systems during the internal "right shift zero fill" steps (this is expected). In tests though, it's shown that by forcing the lib to think you're on a 32 systems greatly reduces the memory footprint. This could of course have undesired consequences too! but if you're happy to try, you can use the RQRCODE_CORE_ARCH_BITS ENV to make this change. e.g RQRCODE_CORE_ARCH_BITS=32.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/whomwah/rqrcode_core.

License

The gem is available as open source under the terms of the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].