npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-isz-ocr

v1.0.1

Published

OCR插件

Downloads

2

Readme

react-native-isz-liveness OCR插件

安装

npm install react-native-isz-ocr

自动link

react-native link react-native-isz-ocr

手动link

  • Android

Application文件 getPackages增加new IShangZuOCRPackage()

 @Override
        protected List<ReactPackage> getPackages() {
            return Arrays.<ReactPackage>asList(
                    new MainReactPackage(),
                    new IShangZuOCRPackage()
            );
        }

app下build.gradle添加依赖

compile project(':react-native-isz-ocr')

settings.gradle文件添加

include ':react-native-isz-ocr'
project(':react-native-isz-ocr').projectDir = new File(settingsDir, '../../android')

aip.license

百度ai官网(https://console.bce.baidu.com/ai/?fromai=1#/ai/ocr/app/detail~appId=486534)下载License文件,放到主项目assets中

API使用

引入

import OcrApi from 'react-native-isz-ocr'

身份证识别

/**
 * 身份证识别
 * @method
 * @param {Object} data
 * @param {String} data.isFront - 是否是身份证正面,默认true,正面
 * @param {String} data.isNativeEnable - 是否开启本地质量控制(自动扫描),默认true
 * @param {String} data.isShowTakePhoto - 是否显示拍照,默认false
 * @param {String} data.isShowAlbum - 是否显示图片选择按钮,默认false
 *
 */


 OcrApi.scanIdCard({
            isFront: isFront,
            isShowAlbum: false,
            isNativeEnable: isFront,
        }).then(message => {
            console.log(message)
            this.show(message,"then")
        }).catch(err => {
            this.show(err,"catch")
        })
  • 返回值{Object}
address: 住址
birthday: 生日 格式为  1999-09-09
cardimage: base64图片
errCode: 错误码 
gender: "男"
name: 姓名
nation: 民族
number: "412726199002096810"
ocrType: "baidu"
path: 本地存储的图片路径
side: 扫描的身份证类型  front:正面 ,back:背面
type: 扫描的身份证类型  1:正面 ,2:背面


expiryDate:  过期时间  格式"20380305"
signDate: 签约日期  格式 "20180305"
authority: 签约日期  格式 "20180305"

银行卡识别

/**
 * 身银行卡识别
 * @method
 * @param {Object} data
 * @param {String} data.isShowAlbum - 是否显示图片选择按钮
 *
 */
      OcrApi.scanBankCard().then(message => {
             console.log(message)
             this.show(message,"then")
         }).catch(err => {
             this.show(err,"catch")
         })
 

-- 返回值 {Object}

bankCardNumber: 银行卡号
bankCardType: 银行卡类型(1 信用卡) 2储蓄卡 0未知银行卡
bankCardTypeName: "Debit",银行卡卡类型名
bankName:  银行名字
cardimage: base64 图片
errCode: 0
path: 本地图片路径