Skip to content
This repository was archived by the owner on Jul 21, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,17 @@
"keypair": "^1.0.1",
"libp2p-crypto-secp256k1": "~0.3.0",
"multihashing-async": "~0.5.1",
"node-forge": "~0.7.6",
"node-forge": "^0.8.5",
"pem-jwk": "^2.0.0",
"protons": "^1.0.1",
"rsa-pem-to-jwk": "^1.1.3",
"tweetnacl": "^1.0.0",
"ursa-optional": "~0.9.10"
},
"devDependencies": {
"aegir": "^18.0.3",
"aegir": "^20.0.0",
"benchmark": "^2.1.4",
"bundlesize": "~0.17.0",
"bundlesize": "^0.18.0",
"chai": "^4.2.0",
"chai-string": "^1.5.0",
"dirty-chai": "^2.0.1"
Expand Down
4 changes: 2 additions & 2 deletions src/keys/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ exports.generateEphemeralKeyPair = require('./ephemeral-keys')

// Generates a keypair of the given type and bitsize
exports.generateKeyPair = (type, bits, cb) => {
let key = supportedKeys[type.toLowerCase()]
const key = supportedKeys[type.toLowerCase()]

if (!key) {
return cb(new Error('invalid or unsupported key type'))
Expand All @@ -40,7 +40,7 @@ exports.generateKeyPair = (type, bits, cb) => {
// Generates a keypair of the given type and bitsize
// seed is a 32 byte uint8array
exports.generateKeyPairFromSeed = (type, seed, bits, cb) => {
let key = supportedKeys[type.toLowerCase()]
const key = supportedKeys[type.toLowerCase()]
if (!key) {
return cb(new Error('invalid or unsupported key type'))
}
Expand Down
2 changes: 1 addition & 1 deletion src/keys/key-stretcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ module.exports = (cipherType, hash, secret, callback) => {
return callback(err)
}

let result = []
const result = []
let j = 0

whilst(
Expand Down
2 changes: 1 addition & 1 deletion src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const BN = require('asn1.js').bignum
// Adapted from https://tools.ietf.org/html/draft-ietf-jose-json-web-signature-41#appendix-C
exports.toBase64 = function toBase64 (bn, len) {
// if len is defined then the bytes are leading-0 padded to the length
let s = bn.toArrayLike(Buffer, 'be', len).toString('base64')
const s = bn.toArrayLike(Buffer, 'be', len).toString('base64')

return s
.replace(/(=*)$/, '') // Remove any trailing '='s
Expand Down
2 changes: 1 addition & 1 deletion test/helpers/test-garbage-error-handling.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function doTests (fncName, fnc, num, skipBuffersAndStrings) {
// skip this garbage because it's a buffer or a string and we were told do do that
return
}
let args = []
const args = []
for (let i = 0; i < num; i++) {
args.push(garbage)
}
Expand Down
2 changes: 1 addition & 1 deletion test/util.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe('Util', () => {
})

it('toBase64 zero padding', (done) => {
let bnpad = new BN('ff', 16)
const bnpad = new BN('ff', 16)
expect(util.toBase64(bnpad, 2)).to.eql('AP8')
done()
})
Expand Down