Sha256: 49f0cdf1a2740497eef2f1024c853c7b8d25e94d81ae0c32397628294c8f5db8

Contents?: true

Size: 343 Bytes

Versions: 9

Compression:

Stored size: 343 Bytes

Contents

#
# calculate md5 of big files, found on usenet
#

if RUBY_VERSION =~ /1\.8/
  # stdlib
  require 'md5'
else
  # stdlib
  require 'digest/md5'
  include Digest
end

class MD5
  def self.file(file)
    File.open(file, "rb") do |f|
      res = self.new
      while (data = f.read(4096))
        res << data
      end
      res
    end
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
gf-treevisitor-0.0.10 lib/gf_utilities/md5.rb
gf-treevisitor-0.0.11 lib/gf_utilities/md5.rb
gf-treevisitor-0.0.12 lib/gf_utilities/md5.rb
gf-treevisitor-0.0.13 lib/gf_utilities/md5.rb
gf-treevisitor-0.0.15 lib/gf_utilities/md5.rb
gf-treevisitor-0.0.16 lib/gf_utilities/md5.rb
gf-treevisitor-0.0.18 lib/gf_utilities/md5.rb
gf-treevisitor-0.0.19 lib/gf_utilities/md5.rb
dircat-0.1.4 lib/dircat/extension_md5.rb