From f229d32442f34859be169e38a42ffecdfb8fc48a Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Thu, 17 Nov 2016 13:49:46 -0800 Subject: Replace old random-id code with incrementing id generator --- app/scripts/lib/random-id.js | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 app/scripts/lib/random-id.js (limited to 'app/scripts/lib/random-id.js') diff --git a/app/scripts/lib/random-id.js b/app/scripts/lib/random-id.js new file mode 100644 index 000000000..3c5ae5600 --- /dev/null +++ b/app/scripts/lib/random-id.js @@ -0,0 +1,9 @@ +const MAX = 1000000000 + +let idCounter = Math.round( Math.random() * MAX ) +function createRandomId() { + idCounter = idCounter % MAX + return idCounter++ +} + +module.exports = createRandomId -- cgit v1.2.3