aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib/random-id.js
blob: 3c5ae56003f43371fda2a9b412f0b66fa10e156b (plain) (blame)
1
2
3
4
5
6
7
8
9
const MAX = 1000000000

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

module.exports = createRandomId