
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
dynamsoft-barcode-reader-web-sdk
Advanced tools
Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR
Dynamsoft JavaScript Barcode Reader is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR Code, DataMatrix, PDF417, and Aztec Code.
Firefox performs the best on both desktop and mobile.
Browser | Version |
---|---|
Chrome | v57+ |
Firefox | v52+ |
Edge | v16+ |
Safari* | v11+ |
Internet Explorer | not supported |
WebAssembly compiles really slow in Safari for iOS according to our tests.
Include and initialize the module:
<script src="/node_modules/dynamsoft-barcode-reader-web-sdk/dist/dbr.min.js"></script>
<script>
dynamsoft.dbrEnv.resourcesPath = '/node_modules/dynamsoft-barcode-reader-web-sdk/dist';
dynamsoft.dbrEnv.bUseWorker = true;
dynamsoft.dbrEnv.licenseKey = "LICENSE_KEY";
dynamsoft.dbrEnv.onAutoLoadWasmSuccess = function(){};
dynamsoft.dbrEnv.onAutoLoadWasmError = function(status){};
</script>
Alternatively, you can use the jsDelivr CDN as follows:
<script src="https://cdn.jsdelivr.net/npm/dynamsoft-barcode-reader-web-sdk"></script>
Read barcodes from a file:
var reader = new dynamsoft.BarcodeReader();
reader.decodeFileInMemory(files[0]).then(function(results){
var txts = [];
for(var i=0;i<results.length;++i){
txts.push(results[i].BarcodeText);
}
reader.deleteInstance();
alert(txts.join("\n"));
}).catch(ex => {
reader.deleteInstance();
});
Read barcodes from a video stream:
var canvas = document.createElement('canvas');
canvas.width = width;
canvas.height = height;
var ctx = canvas.getContext('2d');
ctx.drawImage(videoElement, 0, 0, width, height);
var reader = new dynamsoft.BarcodeReader();
reader.decodeBuffer(
ctx.getImageData(0, 0, width, height).data,
width,
height,
width * 4,
dynamsoft.BarcodeReader.EnumImagePixelFormat.IPF_ARGB_8888
)
.then((results) => {
showResults(results);
});
Create an index.html
file:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
</head>
<body>
<div id="divLoadInfo">Loading SDK...</div>
<input id="uploadImage" type="file" accept="image/bmp,image/jpeg,image/png,image/gif">
<script src="/node_modules/dynamsoft-barcode-reader-web-sdk/dist/dbr.min.js"></script>
<script>
dynamsoft.dbrEnv.resourcesPath = '/node_modules/dynamsoft-barcode-reader-web-sdk/dist';
dynamsoft.dbrEnv.bUseWorker = true;
dynamsoft.dbrEnv.onAutoLoadWasmSuccess = function(){
document.getElementById('divLoadInfo').innerHTML="Successfully loaded JavaScript Barcode SDK.";
};
dynamsoft.dbrEnv.onAutoLoadWasmError = function(status){
document.getElementById('divLoadInfo').innerHTML="Failed to load JavaScript Barcode SDK."+ status;
};
//https://www.dynamsoft.com/CustomerPortal/Portal/TrialLicense.aspx
dynamsoft.dbrEnv.licenseKey = "LICENSE_KEY";
document.getElementById('uploadImage').addEventListener('change', function(){
var files = this.files;
var reader = new dynamsoft.BarcodeReader();
reader.decodeFileInMemory(files[0]).then(function(results){
var txts = [];
for(var i=0;i<results.length;++i){
txts.push(results[i].BarcodeText);
}
reader.deleteInstance();
alert(txts.join("\n"));
}).catch(ex => {
reader.deleteInstance();
alert("Error: "+(ex.message || ex));
console.log(ex);
});
this.value = '';
});
</script>
</body>
</html>
To deploy the project to IIS
, create a web.config
file as follows:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<staticContent>
<mimeMap fileExtension=".wasm" mimeType="application/wasm" />
</staticContent>
</system.webServer>
</configuration>
https://github.com/dynamsoft-dbr/javascript-barcode/blob/master/documents/api-original.md
More: https://github.com/dynamsoft-dbr/javascript-barcode
https://demo.dynamsoft.com/dbr_wasm/barcode_reader_javascript.html
Get a FREE 30-day trial license.
FAQs
Dynamsoft Barcode Reader JS is a recognition SDK which enables you to embed barcode reading functionality in your web, desktop, and mobile applications. With a few lines of JavaScript code, you can develop a robust application to scan a linear barcode, QR
The npm package dynamsoft-barcode-reader-web-sdk receives a total of 0 weekly downloads. As such, dynamsoft-barcode-reader-web-sdk popularity was classified as not popular.
We found that dynamsoft-barcode-reader-web-sdk 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 researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.