Sven Schott wrote:
> http://www.ruby-doc.org/stdlib/libdoc/digest/rdoc/classes/Digest/Class.html
> 
> It shows an example for both a string and a file.

You can also build up a digest iteratively:

require 'digest/sha1'
d = Digest::SHA1.new
d << "hello"
d << " world"
puts d.hexdigest    # or d.digest for binary
-- 
Posted via http://www.ruby-forum.com/.