nifty-wallet/app/scripts/lib/random-id.js

10 lines
200 B
JavaScript
Raw Normal View History

const MAX = Number.MAX_SAFE_INTEGER
2016-11-18 16:27:26 -08:00
let idCounter = Math.round(Math.random() * MAX)
function createRandomId () {
idCounter = idCounter % MAX
return idCounter++
}
module.exports = createRandomId