fix: use nanoid instead of shortid
shortid is deprecated and they recommend nanoid instead. We're not sure if this has to do with possible name collisions or enumerability, but to be sure and on the safe side, we're changing this. nanoid seems quite safe since it uses node's crypto module underneath. Signed-off-by: Erik Michelson <github@erik.michelson.eu>
This commit is contained in:
committed by
Philip Molares
parent
c449d3a815
commit
637c451486
@@ -4,7 +4,7 @@ const Sequelize = require('sequelize')
|
||||
const async = require('async')
|
||||
const moment = require('moment')
|
||||
const childProcess = require('child_process')
|
||||
const shortId = require('shortid')
|
||||
const nanoid = require('nanoid')
|
||||
const path = require('path')
|
||||
|
||||
const Op = Sequelize.Op
|
||||
@@ -44,7 +44,7 @@ function createDmpWorker () {
|
||||
|
||||
function sendDmpWorker (data, callback) {
|
||||
if (!dmpWorker) dmpWorker = createDmpWorker()
|
||||
const cacheKey = Date.now() + '_' + shortId.generate()
|
||||
const cacheKey = Date.now() + '_' + nanoid.nanoid()
|
||||
dmpCallbackCache[cacheKey] = callback
|
||||
data = Object.assign(data, {
|
||||
cacheKey
|
||||
|
||||
Reference in New Issue
Block a user