Last active
December 25, 2015 12:59
-
-
Save ondrek/6980466 to your computer and use it in GitHub Desktop.
Random Uniq Number (only 8-chars)
This file contains hidden or 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
getRandom = function(){ | |
var date = new Date().getTime(); | |
var random = Math.floor((Math.random()*800)+100); | |
return(date+random).toString(36); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Random Uniq Number (only 8-chars)
by Samuel Ondrek
hms2udc2
,hms2ucwc
,hms2ubtt
, ..Why you should use this method?
How it works?
How to improve code to more secure?
Math.floor((Math.random()*8000000)+100)
random+'secretHash'.toString(36)
36
When I cannot use this?
Copyright