Module: Rickshaw::MD5

Defined in:
lib/rickshaw.rb

Class Method Summary collapse

Class Method Details

.hash(file_path) ⇒ Object



11
12
13
14
15
16
17
18
19
20
# File 'lib/rickshaw.rb', line 11

def self.hash(file_path)
  hash = Digest::MD5.new
  open(file_path, 'r') do |io|
    until io.eof?
      buffer = io.read(1024)
      hash.update(buffer)
    end
  end
  hash.hexdigest
end