Comparing version 5.2.0 to 5.3.0
@@ -5,3 +5,3 @@ 'use strict'; | ||
const Reporter = require('../base/reporter').Reporter; | ||
const Buffer = require('buffer').Buffer; | ||
const Buffer = require('safer-buffer').Buffer; | ||
@@ -131,3 +131,3 @@ function DecoderBuffer(base, options) { | ||
if (!out) | ||
out = new Buffer(this.length); | ||
out = Buffer.alloc(this.length); | ||
if (!offset) | ||
@@ -134,0 +134,0 @@ offset = 0; |
'use strict'; | ||
const inherits = require('inherits'); | ||
const Buffer = require('buffer').Buffer; | ||
const Buffer = require('safer-buffer').Buffer; | ||
@@ -49,4 +49,4 @@ const DERDecoder = require('./der'); | ||
const input = new Buffer(base64, 'base64'); | ||
const input = Buffer.from(base64, 'base64'); | ||
return DERDecoder.prototype.decode.call(this, input, options); | ||
}; |
'use strict'; | ||
const inherits = require('inherits'); | ||
const Buffer = require('buffer').Buffer; | ||
const Buffer = require('safer-buffer').Buffer; | ||
const Node = require('../base/node'); | ||
@@ -40,3 +40,3 @@ | ||
if (content.length < 0x80) { | ||
const header = new Buffer(2); | ||
const header = Buffer.alloc(2); | ||
header[0] = encodedTag; | ||
@@ -53,3 +53,3 @@ header[1] = content.length; | ||
const header = new Buffer(1 + 1 + lenOctets); | ||
const header = Buffer.alloc(1 + 1 + lenOctets); | ||
header[0] = encodedTag; | ||
@@ -68,3 +68,3 @@ header[1] = 0x80 | lenOctets; | ||
} else if (tag === 'bmpstr') { | ||
const buf = new Buffer(str.length * 2); | ||
const buf = Buffer.alloc(str.length * 2); | ||
for (let i = 0; i < str.length; i++) { | ||
@@ -134,3 +134,3 @@ buf.writeUInt16BE(str.charCodeAt(i), i * 2); | ||
const objid = new Buffer(size); | ||
const objid = Buffer.alloc(size); | ||
let offset = objid.length - 1; | ||
@@ -206,3 +206,3 @@ for (let i = id.length - 1; i >= 0; i--) { | ||
} | ||
num = new Buffer(numArray); | ||
num = Buffer.from(numArray); | ||
} | ||
@@ -215,3 +215,3 @@ | ||
const out = new Buffer(size); | ||
const out = Buffer.alloc(size); | ||
num.copy(out); | ||
@@ -242,3 +242,3 @@ if (num.length === 0) | ||
return this._createEncoderBuffer(new Buffer(out)); | ||
return this._createEncoderBuffer(Buffer.from(out)); | ||
}; | ||
@@ -245,0 +245,0 @@ |
{ | ||
"name": "asn1.js", | ||
"version": "5.2.0", | ||
"version": "5.3.0", | ||
"description": "ASN.1 encoder and decoder", | ||
@@ -28,3 +28,3 @@ "main": "lib/asn1.js", | ||
"eslint": "^4.10.0", | ||
"mocha": "^2.3.4" | ||
"mocha": "^7.0.0" | ||
}, | ||
@@ -34,4 +34,5 @@ "dependencies": { | ||
"inherits": "^2.0.1", | ||
"minimalistic-assert": "^1.0.0" | ||
"minimalistic-assert": "^1.0.0", | ||
"safer-buffer": "^2.1.0" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
49847
4
+ Addedsafer-buffer@^2.1.0
+ Addedsafer-buffer@2.1.2(transitive)