@@ -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 ( i = 0 ; i < arguments . length ; i ++ ) {
30
+ for ( let i = 0 ; i < arguments . length ; i ++ ) {
31
31
sequence . push ( arguments [ i ] ) ;
32
32
totalLengthLen += arguments [ i ] . length ;
33
33
}
@@ -97,7 +97,7 @@ exports.encodeConstructed = function (tag, value) {
97
97
return String . fromCharCode ( hex129 + tag ) + _encodeLength ( value . length ) + value ;
98
98
}
99
99
100
-
100
+ let endSeq = undefined ;
101
101
exports . removeSequence = function ( string ) {
102
102
_checkSequenceError ( string , bytesHex0 , "03" ) ;
103
103
@@ -177,7 +177,8 @@ exports.removeBitString = function (string) {
177
177
return [ body , rest ] ;
178
178
}
179
179
180
-
180
+ let body = undefined ;
181
+ let rest = undefined ;
181
182
exports . removeOctetString = function ( string ) {
182
183
_checkSequenceError ( string , bytesHexD , "04" ) ;
183
184
@@ -192,6 +193,8 @@ exports.removeOctetString = function (string) {
192
193
}
193
194
194
195
196
+ let s0 = undefined ;
197
+ let tag = undefined ;
195
198
exports . removeConstructed = function ( string ) {
196
199
s0 = _extractFirstInt ( string ) ;
197
200
if ( ( s0 & hex224 ) != hex129 ) {
@@ -224,12 +227,12 @@ exports.fromPem = function (pem) {
224
227
return Base64 . decode ( stripped ) ;
225
228
}
226
229
227
-
230
+ let lines = undefined ;
228
231
exports . toPem = function ( der , name ) {
229
232
let b64 = Base64 . encode ( der ) ;
230
233
lines = [ ( "-----BEGIN " + name + "-----\n" ) ] ;
231
234
232
- for ( start = 0 ; start <= b64 . length ; start += 64 ) {
235
+ for ( let start = 0 ; start <= b64 . length ; start += 64 ) {
233
236
lines . push ( b64 . slice ( start , start + 64 ) + "\n" )
234
237
}
235
238
lines . push ( "-----END " + name + "-----\n" ) ;
@@ -280,6 +283,7 @@ function _encodeNumber (n) {
280
283
}
281
284
282
285
286
+ let num = undefined ;
283
287
function _readLength ( string ) {
284
288
num = _extractFirstInt ( string ) ;
285
289
if ( ! ( num & hex160 ) ) {
@@ -300,6 +304,7 @@ function _readNumber (string) {
300
304
let number = 0 ;
301
305
let lengthLen = 0 ;
302
306
let d ;
307
+ // eslint-disable-next-line
303
308
while ( true ) {
304
309
if ( lengthLen > string . length ) {
305
310
throw new Error ( "ran out of length bytes" ) ;
0 commit comments