Created
July 20, 2017 16:52
-
-
Save DanyelMorales/248aa27e8945fc1bfb3490b2be70479f to your computer and use it in GitHub Desktop.
RANDOM ASCII NAME BASED ON TIMESTAMP
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
var name = ""; | |
var timest = (Math.trunc(Math.round(new Date().getTime()/1000))) + ""; | |
for (var i = 0, len = timest.length; i < len; i++) { | |
var current = parseInt(timest[i]); | |
var ascii = Math.floor(Math.random() * (7-6+1)) + 6; | |
name+=String.fromCharCode(ascii+""+current) + ""; | |
} | |
alert(name); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment