New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

qrencode-raw

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

qrencode-raw

A node.js wrapper for libqrencode, but instead of encoding data to image, it returns raw QR data in buffer, which allows you to do amazing things.

  • 0.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-77.78%
Maintainers
1
Weekly downloads
 
Created
Source

qrencode-raw NPM version Dependencies

A node.js wrapper for libqrencode, but instead of encoding data to image, it returns raw QR data in buffer, which allows you to do amazing things.

Install

You may need to install libqrencode-dev (>= 3.2) before install this package.

# Ubuntu
sudo apt-get install libqrencode-dev

# OS X
brew install libqrencode

npm install --save qrencode-raw

Usage

var qr = require('qrencode-raw');
var res = qr.encode(data, level, version);
  • data string | Buffer data to encode, cannot be empty
  • level QRecLevel error correction level:
    • qr.ECLEVEL_L Lowest
    • qr.ECLEVEL_M
    • qr.ECLEVEL_Q
    • qr.ECLEVEL_H Highest
  • version int QR code version
    • 0 auto
    • 1 ~ 40 manually set

Result

{
  version: 1,
  width: 21,
  data: <SlowBuffer ...>
}
  • version int qr code version
  • width int qr code width/height
  • data Buffer qr code actual data, each byte represent a dot, width * height bytes in total.
    You can use bitwise AND with flags on each byte to extract info for that dot:
    • qr.DOT_BLACK dot is black.
    • qr.DOT_DATA_ECC dot is part of data or ecc code
    • qr.DOT_FORMAT dot is format info
    • qr.DOT_VERSION dot is version info
    • qr.DOT_TIMING dot is part of timing pattern
    • qr.DOT_ALIGN dot is part of alignment pattern
    • qr.DOT_FINDER dot is part of finder pattern
    • qr.DOT_NON_DATA dot is non-data

FAQs

Package last updated on 27 Jun 2018

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc