Created
May 23, 2014 18:14
-
-
Save jpterry/7c80d6f60d9c9a45b319 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
diff --git a/lib/token_generator.rb b/lib/token_generator.rb | |
index 8481154..4fe7527 100644 | |
--- a/lib/token_generator.rb | |
+++ b/lib/token_generator.rb | |
@@ -2,7 +2,6 @@ | |
module TokenGenerator | |
def self.generate | |
- random_text = ([Time.now.to_f] + (1..10).map{rand}).join('--') | |
- ActiveSupport::Base64.encode64_url(Digest::SHA1.digest(random_text)) | |
+ ActiveSupport::Base64.encode64_url(SecureRandom.random_bytes(32)) | |
end | |
-end | |
\ No newline at end of file | |
+end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment