aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib/random-id.js
blob: 78d9e34a5df5aacd4d991aaca57f186b72f326f9 (plain) (blame)
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