RunKit + npm: asn1-ts

node v18.11.0
endpointsharetweet
var asn1Ts = require("asn1-ts") const ber = new asn1Ts.BERElement(); ber.fromBytes( new Uint8Array( [ 48,12,2,1,1,96,7,2,1,3,4,0,128,0 ] ) ); ber.components[0].integer = ber.sequence[0].integer = 5; console.assert( ber.components[0].integer === 5, "[components] failed" ); console.assert( ber.sequence[0].integer === 5, "[sequence] failed" ); const newBytes = ber.toBytes(); console.assert( newBytes[4] === 5, "[toBytes] failed" );
Created from: https://npm.runkit.com/asn1-ts
Loading…