
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
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 native libraries. Just Ruby!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
.
Add this line to your application's Gemfile:
gem "rqrcode_core"
And then execute:
$ bundle
Or install it yourself as:
$ gem install rqrcode_core
$ 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
$ 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.
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
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
RQRCodeCore::QRCode.new("http://kyan.com", size: 1, level: :m, mode: :alphanumeric)
You can run the test suite using:
$ ./bin/setup
$ rake
or try the project from the console with:
$ ./bin/console
The project uses standardrb and can be run with:
$ ./bin/setup
$ rake standard # check
$ rake standard:fix # fix
Bug reports and pull requests are welcome on GitHub at https://github.com/whomwah/rqrcode_core.
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that rqrcode_core demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.