Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想生成由当前时间(到毫秒)和盐字符串(可以是任何东西)组成的字符串的 ASCII SHA1 哈希
有人知道如何实现这样的事情吗?
require 'digest' salt="Celtic Sea" time_now = Time.now Digest::SHA1.hexdigest("%.3f#{salt}" % time_now)