Skip to content

Commit

Permalink
fix: reduce seqno to 8 bytes (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
mpetrunic authored and vasco-santos committed Nov 28, 2019
1 parent a3371a0 commit d26a19c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ exports = module.exports
* @private
*/
exports.randomSeqno = () => {
return crypto.randomBytes(20)
return crypto.randomBytes(8)
}

/**
Expand Down
4 changes: 2 additions & 2 deletions test/utils.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})

Expand Down

0 comments on commit d26a19c

Please sign in to comment.