diff options
author | Dan Finlay <dan@danfinlay.com> | 2016-11-18 05:49:46 +0800 |
---|---|---|
committer | Dan Finlay <dan@danfinlay.com> | 2016-11-18 05:49:46 +0800 |
commit | f229d32442f34859be169e38a42ffecdfb8fc48a (patch) | |
tree | 274a190850635a4e3e82b07de7da4f74248e9dea /app/scripts/lib/random-id.js | |
parent | 161ff62fdcf6f76f7243a1e865dd0cccbc89121f (diff) | |
download | tangerine-wallet-browser-f229d32442f34859be169e38a42ffecdfb8fc48a.tar.gz tangerine-wallet-browser-f229d32442f34859be169e38a42ffecdfb8fc48a.tar.zst tangerine-wallet-browser-f229d32442f34859be169e38a42ffecdfb8fc48a.zip |
Replace old random-id code with incrementing id generator
Diffstat (limited to 'app/scripts/lib/random-id.js')
-rw-r--r-- | app/scripts/lib/random-id.js | 9 |
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 |