ivosh / node-nist Goto Github PK
View Code? Open in Web Editor NEWA simple low-level ANSI/NIST-ITL 1-2011 (update 2015) encoding and decoding utility library. Written in Typescript for Node.
License: MIT License
A simple low-level ANSI/NIST-ITL 1-2011 (update 2015) encoding and decoding utility library. Written in Typescript for Node.
License: MIT License
Hi,
I'm currently trying to get decode to work. Sadly, there is no example. When I figure it out, I might write up an example in my fork and create a pull request. However, it would probably be faster for you to do it.
There are:
export type NistDecodeOptions = NistCodecOptions<
NistFieldDecodeOptions,
NistRecordDecodeOptions,
NistFileEncodeOptions
>;
export interface NistFieldDecodeOptions extends NistFieldCodecOptions {
/** By default the following fields get decoded to a Buffer
* (instead of a NistFieldValue composed from a string or array of strings):
* - 4.009 (DATA)
* - 10.999 (DATA)
*
* This behaviour can be overridden on a per-field basis by passing a custom parser property.
*/
Currently trying to understand these options.
I generated a nist file using nistEncode from the default example. I then tried to decode it.
let input = "1.001:113�1.002:0502�1.003:1�1�2�00�1.004:CRM�1.005:20190717�1.007:DAI035454�1.008:ORI38574354�1.009:TCN2487S054�2.001:56�2.002:00�2.004:John�2.005:Doe�2.007:1978-05-12�";
result = nistLib.nistDecode(
Got error:
{ error:
{ category: 'NIST',
code: 'NIST_DECODE_ERROR',
detail: 'Cannot find NIST file separator between offsets [0, 168].',
endOffset: 168,
nistSource: undefined,
source: undefined,
startOffset: 0 },
tag: 'failure' }
What worked was directly passing the value:
nistDecode(nistEncode(...)) - works
However when I copy the output from nistEncode into a .txt file, then into a string, the nistDecode returns the given error. Some encoding problem?
Hi,
Noticed this comment:
// :TODO: should be determined automatically from WSQ image
const getHorizontalScanningLine = (): string => '500';
// :TODO: should be determined automatically from WSQ image
const getVerticalScanningLine = (): string => '750';
What way would you recommend to implement this?
I am trying to encode a Type 10 Face image in my nist file with utf-8, but when using the syntax used in the node-nist codebase, the image gets corrupted and nist viewers cannot view this utf-8 encoding. Similarly, a base64 encoding causes some issues because it is not supported by the NistFile interface.
This is how I am downloading and reading the image:
const image = await this.downloadImage(user.picture.thumbnail);
const image: string = await fs.promises.readFile('t10-1.jpg','utf-8');
And this is how I am encoding the image into a buffer in the type 10 field:
999: Buffer.from(image, 'utf-8')
Is it possible to encode image data in the Type 10 field, and if so how? Thank you for your time and help!
Hi, great project, could you extend it with support for records type 7, Image Data (User-defined)?
Hi,
i am very thankfull for you effort, you made for us our live much esier with your solution:) So thank you again.
I am having two possibilities which i cannot resolve it by current situation.
Best regards,
Jure
Hello,
could you please add record type 17 to your library?
I could also create a pull request if this is more suitable for you.
Thanks a lot and kind regards
Eric
I suspect I have a ANSI/INCITS 378-2004 minutiae data binary, how do I detect the standard anyways, here is a sample well its base64 but it's binary when decoded, and according to this I have been following: https://templates.machinezoo.com it's probably ANSI/INCITS 378-2004 but though node nist can help me, there is my sample:
Qj4EHM5BFwQhuIFzBCG6g/0EXlyB7QRozoGMBNjQQSwFR9CCcQVXW4LWBWZbhVEFemdAmAWJzkENBajUhR8FvG5EWQXWb4IqBdtbRTgF73xAnQX00EY2Bfl4gVkGGFaFywZkf0HyBn1fhJAGgoCEDAahfoNlBrBxgX0GzmCBIgbZYoCTBuNzgyMG43uCSAcGc0PaBwaEhe8HFopDygdIhkB6B2wCQSwHdnpE3QefikKzB7iCQU8Hx4JFTAfHCkPPCAkEQvoILYRFvAhWDED+CN+IgxgI7o2FGgjzjoRoCQKVg+QJF59CmQkhtoLcCSG7Ql0JJryDjQkroQ==
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.