aboutsummaryrefslogblamecommitdiffstats
path: root/app/scripts/lib/random-id.js
blob: 788f3370f596ecbad9cfecf27182a3d32fbdfbd0 (plain) (tree)
1
2
3
4
5
6
7
8
9
                                   
 

                                               




                               
const MAX = Number.MAX_SAFE_INTEGER

let idCounter = Math.round(Math.random() * MAX)
function createRandomId () {
  idCounter = idCounter % MAX
  return idCounter++
}

module.exports = createRandomId