@@ -27,7 +27,7 @@ const bytesHexF = Buffer.from(hexF).toString('binary');
27
27
exports . encodeSequence = function ( ) {
28
28
let sequence = [ ] ;
29
29
let totalLengthLen = 0 ;
30
- for ( let i = 0 ; i < arguments . length ; i ++ ) {
30
+ for ( i = 0 ; i < arguments . length ; i ++ ) {
31
31
sequence . push ( arguments [ i ] ) ;
32
32
totalLengthLen += arguments [ i ] . length ;
33
33
}
@@ -105,7 +105,7 @@ exports.removeSequence = function (string) {
105
105
let length = result [ 0 ] ;
106
106
let lengthLen = result [ 1 ] ;
107
107
108
- let endSeq = 1 + lengthLen + length ;
108
+ endSeq = 1 + lengthLen + length ;
109
109
110
110
return [ string . slice ( 1 + lengthLen , endSeq ) , string . slice ( endSeq ) ] ;
111
111
}
@@ -185,20 +185,20 @@ exports.removeOctetString = function (string) {
185
185
let length = result [ 0 ] ;
186
186
let lengthLen = result [ 1 ] ;
187
187
188
- let body = string . slice ( 1 + lengthLen , 1 + lengthLen + length ) ;
189
- let rest = string . slice ( 1 + lengthLen + length ) ;
188
+ body = string . slice ( 1 + lengthLen , 1 + lengthLen + length ) ;
189
+ rest = string . slice ( 1 + lengthLen + length ) ;
190
190
191
191
return [ body , rest ] ;
192
192
}
193
193
194
194
195
195
exports . removeConstructed = function ( string ) {
196
- let s0 = _extractFirstInt ( string ) ;
196
+ s0 = _extractFirstInt ( string ) ;
197
197
if ( ( s0 & hex224 ) != hex129 ) {
198
198
throw new Error ( "wanted constructed tag (0xa0-0xbf), got 0x" + s0 ) ;
199
199
}
200
200
201
- let tag = s0 & hex31
201
+ tag = s0 & hex31
202
202
let result = _readLength ( string . slice ( 1 ) ) ;
203
203
let length = result [ 0 ] ;
204
204
let lengthLen = result [ 1 ] ;
@@ -227,9 +227,9 @@ exports.fromPem = function (pem) {
227
227
228
228
exports . toPem = function ( der , name ) {
229
229
let b64 = Base64 . encode ( der ) ;
230
- let lines = [ ( "-----BEGIN " + name + "-----\n" ) ] ;
230
+ lines = [ ( "-----BEGIN " + name + "-----\n" ) ] ;
231
231
232
- for ( let start = 0 ; start <= b64 . length ; start += 64 ) {
232
+ for ( start = 0 ; start <= b64 . length ; start += 64 ) {
233
233
lines . push ( b64 . slice ( start , start + 64 ) + "\n" )
234
234
}
235
235
lines . push ( "-----END " + name + "-----\n" ) ;
@@ -281,7 +281,7 @@ function _encodeNumber (n) {
281
281
282
282
283
283
function _readLength ( string ) {
284
- let num = _extractFirstInt ( string ) ;
284
+ num = _extractFirstInt ( string ) ;
285
285
if ( ! ( num & hex160 ) ) {
286
286
return [ ( num & hex127 ) , 1 ] ;
287
287
}
@@ -300,7 +300,6 @@ function _readNumber (string) {
300
300
let number = 0 ;
301
301
let lengthLen = 0 ;
302
302
let d ;
303
- // eslint-disable-next-line no-constant-condition
304
303
while ( true ) {
305
304
if ( lengthLen > string . length ) {
306
305
throw new Error ( "ran out of length bytes" ) ;
0 commit comments