1.0.1 • Published 3 years ago

@arlenwang/react-native-local-barcode-recognizer v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

React native 本地二维码识别器

react-native-local-barcode-recognizer

安装:

#install:
npm install git+https://github.com/du6688/react-native-local-barcode-recognizer.git

#and link:
react-native link react-native-local-barcode-recognizer

用法:

import LocalBarcodeRecognizer from 'react-native-local-barcode-recognizer';

const imageBase64 = "data:image/jpeg;base64,/9j/4AA.......";

let result = await LocalBarcodeRecognizer.decode(imageBase64.replace("data:image/jpeg;base64,",""), {
            codeTypes: ['ean13', 'qr']
        });

console.log(result);

说明:

修改源码文件,修复二维码识别率过低的问题,添加了ts类型

优化方法参照 文章

API

方法参数
decode(base64编码,options)=> Promise\

options

名称描述
codeTypesaztec,ean13, ean8, qr, pdf417, upc_e, datamatrix, code39, code93, interleaved2of5, codabar, code128, maxicode, rss14, rssexpanded, upc_a, upc_ean