ivosh / node-nist

A simple low-level ANSI/NIST-ITL 1-2011 (update 2015) encoding and decoding utility library. Written in Typescript for Node.
MIT License
12 stars 6 forks source link

Support record Type 7, Image Data (User-defined) #6

Closed MaxAlex666 closed 1 year ago

MaxAlex666 commented 4 years ago

Hi, great project, could you extend it with support for records type 7, Image Data (User-defined)?

ivosh commented 4 years ago

Hei Maxim, Are you using binary (traditional) encoding? For Type-7 to be useful, you would need to supply your own decoding/encoding schema. Otherwise you get just 7.001, 7.002 and the rest of data as one big binary blob. Do you have an example of a NIST file with a decoding schema?

MaxAlex666 commented 4 years ago

Hi Ivosh, yes you're right, a custom set of fields is used when filling out this entry (standard only the first two fields LEN and IDC). Is it possible to encode a custom field structure using your library? (Uses traditional binary encoding) And a similar question: how can I create composite fields? (for example, fields 1.013 / 1.015)

ivosh commented 4 years ago

Hi Maxim, For composite fields, please refer to https://github.com/ivosh/node-nist/blob/master/src/index.ts#L29

For the custom Type-7 encoding, I assume it can be done similarly to the following examples: https://github.com/ivosh/node-nist/blob/master/src/testNistEncoding.ts#L82 https://github.com/ivosh/node-nist/blob/master/src/testNistDecoding.ts

However the problem with Type-7 is that it uses completely custom (binary) encoding, unlike the "text" encoding used for example for Type-2 or Type-10 (which also allow custom fields).

Do you have an example of a NIST file with an encoding/decoding schema?

MaxAlex666 commented 4 years ago

Hi Ivo, sent the file by mail.

ivosh commented 1 year ago

The use case is still not clear even with the NIST file provided. I'am going to close this issue now. If you can provide more information, feel free to reopen.