Created
December 13, 2018 15:13
-
-
Save eldermoraes/c5bf75dd48173f2fd1bb15ad277f04da to your computer and use it in GitHub Desktop.
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
public class TokenUtils { | |
public static String generateToken() { | |
SecureRandom random = new SecureRandom(); | |
long longToken = Math.abs(random.nextLong()); | |
return Long.toString(new Date().getTime()) + Long.toString(longToken, 16); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment