Code Monkey home page Code Monkey logo

node-nist's People

Contributors

isputra avatar ivosh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

node-nist's Issues

Decoding example

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.

Decode from string does not seem to work. Encoding problem?

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?

WSQ image dimensions

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?

Issues encoding and parsing an image using the NistFile interface

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!

Record 2 and Record 14

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.

  1. I need to add sub fileds like 1:013:a and 1:013:b? How can i achive that?
  2. The same situation i have on Record14. I am trying to add records 14:024:a, 14:024:b, 14:024:c and 14:024:d.

Best regards,

Jure

Support record type 17

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

Hey Nice Work, No Examples on Decoding And Can I detect standard?

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==

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.