Sha256: cb2e314cacb22e32ddf18f823a0cd5073421e0387ff47345380d0e638cd21a71
Contents?: true
Size: 428 Bytes
Versions: 5
Compression:
Stored size: 428 Bytes
Contents
require "digest/md5" require "stringio" module Filezor::Util BUFFER_SIZE = 2**16 # Streaming MD5 on IO objects def md5(io) md5 = Digest::MD5.new while chunk = io.read(BUFFER_SIZE) md5 << chunk end io.rewind md5.hexdigest end def files_from_map(map) map.inject([]) do |memo, (path, value)| memo << Filezor::File.new(StringIO.new(value), path) end end extend self end
Version data entries
5 entries across 5 versions & 1 rubygems
Version | Path |
---|---|
filezor-1.3.6 | lib/filezor/util.rb |
filezor-1.3.5 | lib/filezor/util.rb |
filezor-1.3.4 | lib/filezor/util.rb |
filezor-1.3.3 | lib/filezor/util.rb |
filezor-1.3.2 | lib/filezor/util.rb |