Gathering detailed insights and metrics for @panva/asn1.js
Gathering detailed insights and metrics for @panva/asn1.js
ASN.1 DER Encoder/Decoder and DSL for Node.js with no dependencies
npm install @panva/asn1.js
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (100%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
275,127,902
Last Day
139,501
Last Week
625,836
Last Month
2,887,078
Last Year
46,597,818
3 Stars
237 Commits
1 Forks
3 Watching
3 Branches
1 Contributors
Minified
Minified + Gzipped
Latest Version
1.0.0
Package Id
@panva/asn1.js@1.0.0
Size
12.69 kB
NPM Version
6.13.7
Node Version
12.13.0
Publised On
18 Feb 2020
Cumulative downloads
Total Downloads
Last day
-8.7%
139,501
Compared to previous day
Last week
-18%
625,836
Compared to previous week
Last month
3.4%
2,887,078
Compared to previous month
Last year
-33.1%
46,597,818
Compared to previous year
ASN.1 DER Encoder/Decoder and DSL for Node.js with no dependencies
This is a fork of @indutny's asn.js
library with the following
changes made:
.int()
returns are native BigInt
valuesstandard
Define model:
1const asn = require('@panva/asn1.js') 2 3const Human = asn.define('Human', function () { 4 this.seq().obj( 5 this.key('firstName').octstr(), 6 this.key('lastName').octstr(), 7 this.key('age').int(), 8 this.key('gender').enum({ 0: 'male', 1: 'female' }), 9 this.key('bio').seqof(Bio) 10 ) 11}) 12 13const Bio = asn.define('Bio', function () { 14 this.seq().obj( 15 this.key('time').gentime(), 16 this.key('description').octstr() 17 ) 18})
Encode data:
1const output = Human.encode({ 2 firstName: 'Thomas', 3 lastName: 'Anderson', 4 age: 28, 5 gender: 'male', 6 bio: [ 7 { 8 time: new Date('31 March 1999').getTime(), 9 description: 'freedom of mind' 10 } 11 ] 12}, 'der')
Decode data:
1const human = Human.decode(output, 'der') 2console.log(human) 3/* 4{ firstName: <Buffer 54 68 6f 6d 61 73>, 5 lastName: <Buffer 41 6e 64 65 72 73 6f 6e>, 6 age: 28n, 7 gender: 'male', 8 bio: 9 [ { time: 922820400000, 10 description: <Buffer 66 72 65 65 64 6f 6d 20 6f 66 20 6d 69 6e 64> } ] } 11*/
Its possible to parse data without stopping on first error. In order to do it, you should call:
1const human = Human.decode(output, 'der', { partial: true }) 2console.log(human) 3/* 4{ result: { ... }, 5 errors: [ ... ] } 6*/
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
5 existing vulnerabilities detected
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
Found 0/25 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More