From d26a19c93e01b2dd13752dd70b1f7a98cb7672c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marin=20Petruni=C4=87?= Date: Thu, 28 Nov 2019 11:17:44 +0100 Subject: [PATCH] fix: reduce seqno to 8 bytes (#31) --- src/utils.js | 2 +- test/utils.spec.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/utils.js b/src/utils.js index d9c6033045..17cd172381 100644 --- a/src/utils.js +++ b/src/utils.js @@ -12,7 +12,7 @@ exports = module.exports * @private */ exports.randomSeqno = () => { - return crypto.randomBytes(20) + return crypto.randomBytes(8) } /** diff --git a/test/utils.spec.js b/test/utils.spec.js index d1e00b0ca5..f924884080 100644 --- a/test/utils.spec.js +++ b/test/utils.spec.js @@ -10,8 +10,8 @@ describe('utils', () => { const first = utils.randomSeqno() const second = utils.randomSeqno() - expect(first).to.have.length(20) - expect(second).to.have.length(20) + expect(first).to.have.length(8) + expect(second).to.have.length(8) expect(first).to.not.eql(second) })