aboutsummaryrefslogtreecommitdiffstats
path: root/app/scripts/lib/random-id.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/scripts/lib/random-id.js')
-rw-r--r--app/scripts/lib/random-id.js9
1 files changed, 9 insertions, 0 deletions
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