Skip to content

Instantly share code, notes, and snippets.

@pelle
Created June 1, 2009 01:53
Show Gist options
  • Save pelle/121129 to your computer and use it in GitHub Desktop.
Save pelle/121129 to your computer and use it in GitHub Desktop.
How to call timecert
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