printcatcher
v0.1.0
Published
Node.js framework for fingerprint enrollment/verification/identification with a DigitalPersona U.are.U 4500 reader
Downloads
27
Maintainers
Readme
printcatcher
Node.js framework for fingerprint enrollment, verification, and 1:N identification with a DigitalPersona U.are.U 4500 reader.
Calls into the official DigitalPersona U.are.U SDK through a small compiled
Fortran helper (printcatcher_cli.exe), spawned as a subprocess rather than
called via direct FFI (ctypes/koffi-style dynamic FFI calls into the SDK's
device-enumeration function were found to silently fail — see the main
repo's README for how that was diagnosed). Windows-only.
Requirements
- Windows, x64.
- The official U.are.U SDK installed (provides
dpfpdd.dll/dpfj.dlland the reader's device driver). - A U.are.U 4500 reader connected, on its normal Windows driver.
Install
npm install printcatcherUsage
const { PrintCatcherClient, FINGERS } = require('printcatcher');
const client = new PrintCatcherClient({ templatesDir: './templates' });
client.on('waiting', () => console.log('place your finger on the sensor'));
client.on('sample', ({ sample, total }) => console.log(`sample ${sample}/${total}`));
client.on('captured', ({ imageDataUrl }) => {
// imageDataUrl is a ready-to-use "data:image/png;base64,..." string --
// drop it straight into <img src="..."> for a live capture preview.
});
await client.enroll('alice', { finger: FINGERS.RIGHT_THUMB });
const result = await client.verify('alice', { finger: FINGERS.RIGHT_THUMB });
// { userId: 'alice', finger: 'right-thumb', score: 0, isMatch: true }
const who = await client.identify();
// { match: 'alice__right-thumb.fmd', userId: 'alice', finger: 'right-thumb', score: 0, isMatch: true }See examples/basic_usage.js for a runnable end-to-end script.
API
new PrintCatcherClient(options)
options.templatesDir— where enrolled templates are stored (default:./printcatcher-templates).options.matchThreshold— dissimilarity score cutoff forisMatch(default5000; 0 = identical, larger = more different — tune this for your own false-accept/false-reject tolerance, this default is a starting point, not a certified security threshold).
client.enroll(userId, { finger, numSamples, timeoutMs })
Captures multiple samples (the SDK decides internally how many it actually
needs, up to numSamples, default 4) and stores the resulting template.
finger is one of the FINGERS constants (default FINGERS.UNKNOWN).
client.verify(userId, { finger, timeoutMs, matchThreshold })
Captures one sample and compares it 1:1 against userId's stored template
for that finger. Throws if no such template is enrolled.
client.identify({ timeoutMs, matchThreshold })
Captures one sample and compares it 1:N against every enrolled template.
Returns { match: null, ... } if nothing scores within the threshold.
client.capture({ timeoutMs, outPath })
Raw single capture with no enrollment/matching — useful for a "test the reader" diagnostic, or feeding your own matching pipeline.
Events
waiting— emitted right before each blocking capture call; this is your cue to show "place your finger now" in a UI.sample—{ sample, total }, emitted duringenroll()before each of its (up tonumSamples) captures.captured—{ previewPath, width, height, imagePng, imageDataUrl }, emitted after every capture (including each one during enrollment).imagePngis aBuffer;imageDataUrlis ready to drop into an<img>tag.
Finger position constants
FINGERS.RIGHT_THUMB, RIGHT_INDEX, RIGHT_MIDDLE, RIGHT_RING,
RIGHT_LITTLE, LEFT_THUMB, LEFT_INDEX, LEFT_MIDDLE, LEFT_RING,
LEFT_LITTLE, UNKNOWN. Enrolling different fingers for the same
userId are independent templates (<userId>__<finger>.fmd), so one user
can enroll multiple fingers as backups.
Source
Full source, the native CLI helper it's built on, and the story of how this was built: https://github.com/msaikens/printCatcher
