def digest_io(io)
      digester = Digest::SHA1.new

      while buffer = io.read(1024)
        digester.update(buffer)
      end

      io.rewind

      Base64.encode64(digester.digest)
    end
def digest_io(io)
      digester = Digest::SHA1.new

      while buffer = io.read(1024)
        digester.update(buffer)
      end

      io.rewind

      Base64.encode64(digester.digest)
    end
Hash the given object.

 @param [String, IO] object
   a string or IO object to hash

 @return [String]
   the hashed value


 Digest the given IO, reading in 1024 bytes at one time.

 @param [IO] io
   the IO (or File object)

 @return [String]