Last active
August 29, 2015 14:20
-
-
Save edysegura/fa210049c5895bcebb28 to your computer and use it in GitHub Desktop.
[JS] Unique ID with JS - source http://jsbin.com/telokagigo/3/edit?js,console
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function random(seed) { | |
if (!seed) | |
seed = new Date().getTime(); | |
seed = (seed*9301+49297) % 233280; | |
return seed/(233280.0) * 100; | |
} | |
function seed() { | |
var seedNumber = (Math.random() * Math.pow(10, 17) + Math.random() * Math.pow(10, 17) + Math.random() * Math.pow(10, 17) + Math.random() * Math.pow(10, 17)); | |
return seedNumber; | |
} | |
for(var i=0; i<100; i++){ | |
console.log(random(seed())); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment