Today I'm retiring old tailor-made big integer code from #asn1js and while I'm happy ES2020 support proper BigInts, I feel a bit sentimental about it.

It's a small silly thing, but I wrote it so many years ago, and it did its small job very well; that is, only parsing arbitrarily long binary integer values and printing them efficiently in decimal, nothing more, nothing less.

/** * Multiply value by m and add c. * @param {number} m - multiplier, must be 0<m<=256 * @param {number} c - value to add, must be c>=0 */ mulAdd(m, c) { let b = this.buf, l = b.length, i, t; for (i = 0; i < l; ++i) { t = b[i] * m + c; if (t < max) c = 0; else { c = 0|(t / max); t -= c * max; } b[i] = t; } if (c > 0) b[i] = c; }
Drop Int10 in favor of BigInt (available since ES2020). · lapo-luchini/asn1js@8d5f51d

Code is now just slightly faster (-0.28%) but the main reason is not reinventing the wheel. Goodbye Int10, you'll be forever remembered in the repo history.

GitHub
In new #ASN1js version 2.1.0 I changed the logic of the shown #ASN1 field names due to research started with GitHub issue #102:
Previously it would have shown simply as issuer, but fixing another issue I had a (kinda) regression and it shown only the CHOICE identifier (in this case rdnSequence).
In the end, I think that probably the best choice is to show both names, the base one as it usually is more useful to identify the field, but the CHOICE name to know which sub-case this is. This leads to a bit of uninteresting info such as the notBefore utcTime UTCTime, but that's the (small) price to be paid.
This was a delicate change, so first thing I extended the test harness in order to check that a few important examples decode to what is expected.

Releases a few updates to #asn1js today:

ASN.1 JavaScript decoder

ASN1js tree mode

Public request for comments: #ASN1js has historically been like this, I have received a very nice PR on Github to make it more like the usual tree view with ...

ASN1js is now available as a #VSCode extension.

#asn1 #asn1js

asn1js - Visual Studio Marketplace

Extension for Visual Studio Code - Decode ASN.1 content

ASN1js now (also on) ESM

I released a 'next' version of #ASN1js on npm which drops any AMD/UMD boilerplate and only uses ES6 modules. I'm waiting for the forthcoming #NodeJS sync re...

@cpu Oh, my #asn1js doesn't support it, what a shame.
(actually uses Peter Gutmann's dumpasn1.cfg file)
ASN.1 JavaScript decoder

Added PKCS#10 support to ASN1js

Tonight I added PKCS#10 support to #ASN1js. …by parsing RFC 2986 and, unfortunately, by applying a minimal set of patches to simplify its ASN.1 dialect as...

New #ASN1js feature: showing field names, as taken from #ASN1 module definitions parsed right out of #RFC.
Consider it beta for now (currently supports only X.509 and CMS definitions, but this will change in the future).