Reputation: 1267
I want to generate ASCII SHA1 Hash of a string comprised of the current time (to millisecond) and a salt string (can be anything)
Does someone know how to implement such thing?
Upvotes: 1
Views: 143
Reputation: 7540
require 'digest'
salt="Celtic Sea"
time_now = Time.now
Digest::SHA1.hexdigest("%.3f#{salt}" % time_now)
Upvotes: 4