Created
June 1, 2009 01:53
-
-
Save pelle/121129 to your computer and use it in GitHub Desktop.
How to call timecert
This file contains hidden or 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
require 'digest/sha1' | |
require 'open-uri' | |
# Calculate the digest of content | |
def digest(content) | |
Digest::SHA1.hexdigest(content) | |
end | |
# Gets the timecert timestamp for a given piece of content | |
def timecert(content) | |
Time.parse(open("http://timecert.org/#{digest(content)}.time").read) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment