def perform_checksum_ruby(method)
      # This is used to skip attempting other checksum methods. If this is set
      # then we know all other methods have failed.
      @ruby_checksum_fallback = true
      case method
      when :md5
        res = Digest::MD5.new
      when :sha256
        res = Digest::SHA256.new
      end

      res.update(content)
      res.hexdigest
    rescue TypeError => _
      nil
    end
def perform_checksum_ruby(method)
      # This is used to skip attempting other checksum methods. If this is set
      # then we know all other methods have failed.
      @ruby_checksum_fallback = true
      case method
      when :md5
        res = Digest::MD5.new
      when :sha256
        res = Digest::SHA256.new
      end

      res.update(content)
      res.hexdigest
    rescue TypeError => _
      nil
    end
This pulls the content of the file to the machine running Train and uses
 Digest to perform the checksum. This is less efficient than using remote
 system binaries and can lead to incorrect results due to encoding.