Skip to content

Commit

Permalink
fix: replace shortid with hyperid #565 (#567)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando committed Dec 7, 2020
1 parent fd89122 commit 831048b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/Client.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ a read-only flag indicates if client is closed or not.

## client.id

- `<string>` __Default__: `aedes_${shortid()}`
- `<string>` __Default__: `aedes_${hyperid()}`

Client unique identifier, specified by CONNECT packet.

Expand Down
4 changes: 2 additions & 2 deletions lib/handlers/connect.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const write = require('../write')
const QoSPacket = require('../qos-packet')
const { through } = require('../utils')
const handleSubscribe = require('./subscribe')
const shortid = require('shortid')
const uniqueId = require('hyperid')()

function Connack (arg) {
this.cmd = 'connack'
Expand Down Expand Up @@ -75,7 +75,7 @@ function init (client, packet, done) {
return
}

client.id = clientId || 'aedes_' + shortid()
client.id = clientId || 'aedes_' + uniqueId()
client.clean = packet.clean
client.version = packet.protocolVersion
client._will = packet.will
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,12 @@
"fastfall": "^1.5.1",
"fastparallel": "^2.4.0",
"fastseries": "^2.0.0",
"hyperid": "^2.0.5",
"mqemitter": "^4.4.0",
"mqtt-packet": "^6.6.0",
"readable-stream": "^3.6.0",
"retimer": "^2.0.0",
"reusify": "^1.0.4",
"shortid": "^2.2.16",
"uuid": "^8.3.1"
}
}

0 comments on commit 831048b

Please sign in to comment.