lib/ruby_ext/string.rb in ruby-ext-0.2.9 vs lib/ruby_ext/string.rb in ruby-ext-0.2.10
- old
+ new
@@ -16,6 +16,11 @@
return gsub(/\#\{.+?\}/) do |term|
identifier = term.slice(2 .. term.size-2)
binding.eval identifier
end
end
+
+ def self.secure_token
+ original = [Time.now, (1..10).map{ rand.to_s }]
+ Digest::SHA1.hexdigest(original.flatten.join('--'))
+ end
end
\ No newline at end of file