All Projects → maslick → koder

maslick / koder

Licence: MIT License
QR/bar code scanner for the Browser

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects
C++
36643 projects - #6 most used programming language
CSS
56736 projects
Dockerfile
14818 projects
Makefile
30231 projects

Projects that are alternatives of or similar to koder

Emscripten Docker
Docker image with Emscripten to compile ASM.js and WebAssembly
Stars: ✭ 92 (+26.03%)
Mutual labels:  webassembly, wasm, emscripten
Webassembly Examples
From Simple To Complex. A complete collection of webassembly examples.
Stars: ✭ 177 (+142.47%)
Mutual labels:  webassembly, wasm, emscripten
Assortedwidgets
OpenGL GUI library
Stars: ✭ 92 (+26.03%)
Mutual labels:  webassembly, wasm, emscripten
Wasmjit
Small Embeddable WebAssembly Runtime
Stars: ✭ 1,063 (+1356.16%)
Mutual labels:  webassembly, wasm, emscripten
Zxinglite
🔥 ZXing的精简版,优化扫码和生成二维码/条形码,内置闪光灯等功能。扫描风格支持:微信的线条样式,支付宝的网格样式。几句代码轻松拥有扫码功能 ,ZXingLite让集成更简单。(扫码识别速度快如微信)
Stars: ✭ 2,117 (+2800%)
Mutual labels:  qrcode, barcode, zbar
Opus Stream Decoder
Instantly decode Ogg Opus audio streams in chunks with JavaScript & WebAssembly (Wasm)
Stars: ✭ 80 (+9.59%)
Mutual labels:  webassembly, wasm, emscripten
Modern Wasm Starter
🛸 Run C++ code on web and create blazingly fast websites! A starter template to easily create WebAssembly packages using type-safe C++ bindings with automatic TypeScript declarations.
Stars: ✭ 140 (+91.78%)
Mutual labels:  webassembly, wasm, emscripten
Wac
WebAssembly interpreter in C
Stars: ✭ 372 (+409.59%)
Mutual labels:  webassembly, wasm, emscripten
Qr Code Scanner
📠 A simple, fast and useful progressive web application
Stars: ✭ 982 (+1245.21%)
Mutual labels:  qrcode, barcode, qr
garden.zbarcam
Migrated to https://github.com/kivy-garden/zbarcam
Stars: ✭ 49 (-32.88%)
Mutual labels:  qrcode, barcode, zbar
Cppwasm Book
📚 WebAssembly friendly programming with C/C++ -- Emscripten practice
Stars: ✭ 956 (+1209.59%)
Mutual labels:  webassembly, wasm, emscripten
dart barcode
Barcode generation library
Stars: ✭ 79 (+8.22%)
Mutual labels:  barcode, ean13, ean8
Camaro
camaro is an utility to transform XML to JSON, using Node.js binding to native XML parser pugixml, one of the fastest XML parser around.
Stars: ✭ 438 (+500%)
Mutual labels:  webassembly, wasm, emscripten
Wasmer
🚀 The leading WebAssembly Runtime supporting WASI and Emscripten
Stars: ✭ 11,047 (+15032.88%)
Mutual labels:  webassembly, wasm, emscripten
Rustynes
👾 An NES emulator by Rust and WebAssembly
Stars: ✭ 399 (+446.58%)
Mutual labels:  webassembly, wasm, emscripten
Dcmjs
dcmjs is a javascript cross-compile of dcmtk (dcmtk.org).
Stars: ✭ 92 (+26.03%)
Mutual labels:  webassembly, wasm, emscripten
Wasm Git
GIT for nodejs and the browser using https://libgit2.org compiled to WebAssembly with https://emscripten.org
Stars: ✭ 261 (+257.53%)
Mutual labels:  webassembly, wasm, emscripten
barcoder
Lightweight Barcode Encoding Library for .NET Framework, .NET Standard and .NET Core.
Stars: ✭ 76 (+4.11%)
Mutual labels:  barcode, ean13, ean8
android-zbar-sdk
🔗 android-zbar-sdk, provide jni source, so file and jar file used alone, gradle/maven remote dependencies.
Stars: ✭ 311 (+326.03%)
Mutual labels:  qrcode, barcode, zbar
TypeScriptXX
🧷 Stay safe! Type-safe scripting for C++ using TypeScriptToLua and CMake with auto-generated declarations.
Stars: ✭ 33 (-54.79%)
Mutual labels:  webassembly, wasm, emscripten

=koder=

QR/bar code scanner for the Browser

npm Build Status License: MIT

💡 Demo

https://qr.maslick.tech

🚀 Features

  • QR/barcode module implemented in WebAssembly
  • Barcode support (UPC-A, UPC-E, EAN-8, EAN-13, I25, CODE-128)
  • Uses Zbar C++ library (version 0.23.90)
  • Packaged as PWA (caching files with Service Worker, Add to Home Screen)
  • Mobile first (can be used on a Laptop as well)
  • Multiplatform (iOS, Android, Desktop)
  • QR/bar code recognition logic is performed off the browser's Main thread (i.e. Web Worker)
  • koder React component supports a jsqr based Web Worker (see jsQrWorker.js)
  • Emscripten-zbar-sdk Docker image based on emscripten/emsdk, Dockerfile
  • ReactJS component
  • Vanilla JS example
  • 🆕 Turn on/off the beep sound
  • 🆕 Support for UPN QR (Slovenia only)
  • 🆕 EU Digital Covid Certificate validator (vaccination, test), works in offline mode!
  • 🆕 Emscripten v3.1.1
  • 🆕 npm package

Usage

Install dependencies

npm install --global yarn
yarn install --frozen-lockfile

Run React app

npm run start
open https://locahost:8080

Productionize

npm run build                # -> build React app into ./public
npm run prod                 # -> serve static web app on port 8082
open http://localhost:8082

NPM module

npm install @maslick/koder
// CommonJS
const Koder = require('@maslick/koder');

// ES6 modules
import Koder from '@maslick/koder';
const Koder = require('@maslick/koder');
const {loadImage, createCanvas} = require("canvas");

const getImageData = async (src) => {
  const img = await loadImage(src);
  const canvas = createCanvas(img.width, img.height);
  const ctx = canvas.getContext('2d');
  ctx.drawImage(img, 0, 0);
  return {
    data: ctx.getImageData(0, 0, img.width, img.height).data,
    width: img.width,
    height: img.height
  };
};

(async () => {
  const url = 'https://raw.githubusercontent.com/maslick/koder/master/screenshots/app_1.png';
  const koder = await new Koder().initialized;
  const {data, width, height} = await getImageData(url);

  const t0 = new Date().getTime();
  const res = koder.decode(data, width, height);
  const t1 = new Date().getTime();

  console.log(`Scanned in ${t1-t0} ms`);  // Scanned in 7 ms
  console.log(res);                       // http://en.m.wikipedia.org
})();

♠️ Development

Fetch or build the Builder image

docker pull maslick/emscripten-zbar-sdk
docker build -t maslick/emscripten-zbar-sdk -f docker/Dockerfile docker

Build WASM artifacts

# React app
docker run \
  -e INPUT_FILE=zbar/qr.cpp \
  -e OUTPUT_FILE=zbar \
  -e OUTPUT_DIR=public/wasm \
  -v $(pwd):/app \
  maslick/emscripten-zbar-sdk make -B

Clean the build artifacts (if necessary):

# React app
OUTPUT_DIR=public/wasm OUTPUT_FILE=zbar make clean

🔭 References

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].