Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
qrcode-opencv-wechat
Advanced tools
[![NPM version](https://img.shields.io/npm/v/qrcode-opencv-wechat?color=a1b858&label=)](https://www.npmjs.com/package/qrcode-opencv-wechat)
QR Code scanner in JavaScript, based on a WebAssembly build of OpenCV with Open CV WeChat QR Code Scanner. Provides a much better detection rate and error tolerance.
Ported and rewritten from leidenglai/opencv-js-qrcode for modern browser build and easier usage. Huge thanks to @leidenglai for the previous work and research.
npm i qrcode-opencv-wechat
import { scan } from 'qrcode-opencv-wechat'
const result = await scan(canvas) // Or ImageElement
Upon the first call of scan
, around 3.5MB gzipped of WebAssembly and models will be loaded asynchronously.
You can also preload them with:
import { ready, scan } from 'qrcode-opencv-wechat'
await ready()
const result = await scan(canvas)
In case you want to scan with streams like camera inputs, here is some code snippet for reference
<video id="video">
import { scan } from 'qrcode-opencv-wechat'
const stream = await navigator.mediaDevices.getUserMedia({
audio: false,
video: {
width: 512,
height: 512,
},
})
const video = document.getElementById('video')
video.srcObject = stream
video.play()
async function scanFrame() {
const canvas = document.createElement('canvas')
canvas.width = video.value.videoWidth
canvas.height = video.value.videoHeight
const ctx = canvas.getContext('2d')
ctx.drawImage(videoEl.value!, 0, 0, canvas.width, canvas.height)
const result = await scan(canvas)
if (result?.text)
alert(result?.text)
}
setInterval(scanFrame, 100) // scan one frame every 100ms
MIT License © 2023 Anthony Fu
FAQs
[![NPM version](https://img.shields.io/npm/v/qrcode-opencv-wechat?color=a1b858&label=)](https://www.npmjs.com/package/qrcode-opencv-wechat)
The npm package qrcode-opencv-wechat receives a total of 4,533 weekly downloads. As such, qrcode-opencv-wechat popularity was classified as popular.
We found that qrcode-opencv-wechat 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.