Sha256: 1b78340919fc2292d49d51b52f53b3fca5fb672ae529653ec57be64e135c52c8

Contents?: true

Size: 372 Bytes

Versions: 1

Compression:

Stored size: 372 Bytes

Contents

require 'digest/sha1'
require 'rickshaw/version'
require 'core_ext/string/to_sha1'

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rickshaw-0.0.2 lib/rickshaw.rb