Code Monkey home page Code Monkey logo

uareu-node's Introduction

uareu-node · npm version GitHub license

uareu-node is a typescript library that aims to allow communication between a nodejs application and the DLL / SO of the DPFJ and DPFPDD libraries created by DigitalPersona / HID Global.

  • Attention:

    • This library has only been tested in this environment(s):

      • SO: Windows;
      • Architecture: x64;
      • NodeJS: [12.17.0(x64), 12.13.0(x32)];
    • This library does not replace the original library provided by HID Global, only facilities the communication between it and the aplication.

    • Originally this library was created to a specific device (Digital Persona 4500 Fingerprint Reader), but while we were running the tests, another device worked (Synaptics FP sensor) a device built into the laptop.

    • If using the x32 dpfj and dpfpdd libraries, use a x32 node version, if using x64, use a x64 node version. :)

Requirements

  • A Digital Persona 4500 Fingerprint Reader or similar;

  • dpfj.dll, dpfpdd.dll for Windows, and dpfj.so, dpfpdd.so for Linux, both should be located in a folder named "bin" at the root of the project.

    .
    ├── ...
    ├── bin                     # Libraries files
    │   ├── dpfj.dll            # DPFJ library
    │   ├── dpfpdd.dll          # DPFPDD library
    │   └── ...                 # etc.
    └── ...
    
  • If you choose to keep the library files in another location, when loading the library you must provide the path to the libraries.

    • Example:
          // You just need to specific the path if the libs are not in a 'bin' folder at root.
          uareu.loadLibs('src/libs/dpfpdd.dll', 'src/libs/dpfj.dll')
              .then((res) => {
                  console.log(res);
              })
              .catch((err) => {throw err;});

Installation

Just need to invoke:

$ npm install uareu-node

Examples

You can find this example inside the 'example' folder, and run it invoking:

$ node example/index.js

Code:

    const { UareU, CONSTANTS } = require('uareu-node'); // Import
    const uareu = UareU.getInstance(); // Get a unique instance of library handler.
    let reader; // Create a variable to keep the reader handle after 'open' the device.

    // Probably the code below will also work for you.
    uareu.loadLibs() // Load libs
        .then(() => uareu.dpfpddInit()) // Init libs
        .then(() => uareu.dpfpddQueryDevices()) // Search reader devices connected
        .then((res) => uareu.dpfpddOpen(res.devicesList[0])}) // 'Open' the reader device, it's needed for use others functions like: dpfpddCaptureAsync
        .then((res) => { if (res) reader = res }) // Set reader variable
        .catch((err) => { throw err; });

    // After this initial configuration you can create some functions to capture a fingerprint, identify it, compare it and etc...
    // Note: Identify and Compare are different, the main diference between it are: - Compare only compares two fingerprints;  - Identify compares a fingerprint against a list of fingerprints;

    uareu.dpfpddCaptureAsync(reader, CONSTANTS.DPFPDD_IMAGE_FMT.DPFPDD_IMG_FMT_ANSI381, CONSTANTS.DPFPDD_IMAGE_PROC.DPFPDD_IMG_PROC_DEFAULT, (data, dataSize) => {
        // Here you receive the data of a fingerprint image data (FID)
        // Before compare it, you need to generate a fingerprint minutie data (FMD)
        uareu.dpfjCreateFmdFromFid(data, CONSTANTS.DPFJ_FMD_FORMAT.DPFJ_FMD_ANSI_378_2004)
        .then((res) => {
            // Here you receive the FMD and then you can compare it, save it to compare with the next fingerprint, identify it with a database, etc...
            return uareu.dpfjIdentify(res, [FMD LIST]);
        })
        .then((res) => {
            // Finger was identified or not? The answer you get here.
        })
        .catch((err) => console.log(err));
    });

Contributing

One of the problems that we have already identified, but we have not been able to find a solution is the fact that nodejs stops running a few times when removing and placing the finger very quickly on the reader. Can you help us? Any help is welcome, open a issue, make a pull request, send me a email: [email protected].

License

MIT License. See the LICENSE file.

uareu-node's People

Contributors

lucasfelipecdm avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.