Sha256: 9ff0cf4d8fe4c84115c4e53a640a4bf5ec9f0f90345047f9d05ce7b4dae97aa4
Contents?: true
Size: 1.02 KB
Versions: 1
Compression:
Stored size: 1.02 KB
Contents
require 'digest/md5' require 'digest/sha1' require 'digest/sha2' require 'rickshaw/version' require 'core_ext/string/to_md5' require 'core_ext/string/to_sha1' require 'core_ext/string/to_sha256' require 'core_ext/string/to_base64' require 'core_ext/string/byte_packing' module Rickshaw module MD5 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 end 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 module SHA256 def self.hash(file_path) hash = Digest::SHA256.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.4.0 | lib/rickshaw.rb |