asn1.js icon indicating copy to clipboard operation
asn1.js copied to clipboard

Encoding/decoding negative integers and bigger integers

Open killerstorm opened this issue 6 years ago • 5 comments

I added support for encoding & decoding negative integers. Existing implementation was producing erroneous values.

I've added tests for numbers at the edges: -1, -128, -129. No extensive testing was done.

killerstorm avatar Oct 30 '17 19:10 killerstorm

I actually just added eslint to the package.json. So you can run npm run lint to fix the most of these issues.

indutny avatar Oct 31 '17 14:10 indutny

Thx, I also want to fix encoding JS integers > 2^32-1 while we are here. If you don't mind I'll redirect them to BN.

killerstorm avatar Nov 01 '17 09:11 killerstorm

Hi, I fixed lint issues and also added support for integers >= 2^31.

I don't see BN.fromTwos in BN library so I don't see an opportunity to handle it in a more efficient way.

Note that test "should encode OCSP request" fails, but it fails without my changes too.

killerstorm avatar Dec 01 '17 00:12 killerstorm

Is this going to be merged?

blmalone avatar Aug 14 '18 19:08 blmalone

Is this only a conflict issue ? I need number support > 32 bits.

Kalmac avatar Oct 26 '21 16:10 Kalmac