Security News
The Push to Ban Ransom Payments Is Gaining Momentum
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
barcode-detector
Advanced tools
Readme
Spec compliant polyfill of the Barcode Detection API.
It can be used for barcode/QR-code recognition in images from various kinds of
sources including <canvas>
, <img>
, <image>
(inside SVGs), <video>
, File
, Blob
, ImageData
, ImageBitmap
, OffscreenCanvas
.
Design goals:
npm install barcode-detector
import BarcodeDetector from "barcode-detector"
// polyfill unless already supported
if (!("BarcodeDetector" in window)) {
window.BarcodeDetector = BarcodeDetector
}
// pick barcode formats. Other formats will be ignored
const barcodeDetector = new BarcodeDetector({ formats: ["qr_code"] })
// directly pass an image element, video element, ...
const barcodes = await barcodeDetector.detect(someImageSource)
// can detect multiple barcodes in one image
const [ barcode1, barcode2, ...evenMoreBarcodes ] = barcodes
// access encoded string
const { rawValue } = barcode1
For in-depth documentation checkout the corresponding MDN page.
src/BarcodeDetectorJsqr.ts
:
aztec
code_128
code_39
code_93
codabar
data_matrix
ean_13
ean_8
itf
pdf417
qr_code
upc_a
upc_e
src/BarcodeDetectorZXing.ts
(not exposed at the moment. See #1):
aztec
code_128
code_39
code_93
codabar
data_matrix
ean_13
ean_8
itf
pdf417
qr_code
upc_a
upc_e
FAQs
A Barcode Detection API polyfill that uses ZXing webassembly under the hood
We found that barcode-detector demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Ransomware costs victims an estimated $30 billion per year and has gotten so out of control that global support for banning payments is gaining momentum.
Application Security
New SEC disclosure rules aim to enforce timely cyber incident reporting, but fear of job loss and inadequate resources lead to significant underreporting.
Security News
The Python Software Foundation has secured a 5-year sponsorship from Fastly that supports PSF's activities and events, most notably the security and reliability of the Python Package Index (PyPI).