lib/rulebow/digest.rb
# Compute the sha1 identifer for a file.
#
# file - path to a file
#
# Returns [String] SHA1 digest string.
Compute the sha1 identifer for a file.
file - path to a file

Returns [String] SHA1 digest string.
Compute the sha1 identifer for a file . file - path to a file Returns [ String ] SHA1 digest string .
def checksum(file)
      sha = ::Digest::SHA1.new
      File.open(file, 'r') do |fh|
        fh.each_line do |l|
          sha << l
        end
      end
      sha.hexdigest
    end
def checksum ( file ) sha = :: Digest :: SHA1 . new File . open ( file , 'r' ) do | fh | fh . each_line do | l | sha << l end end sha . hexdigest end
Compute the sha1 identifer for a file.
Compute the sha1 identifer for a file .
file
<not_specific>