lib/new_relic/agent/obfuscator.rb in newrelic_rpm-8.9.0 vs lib/new_relic/agent/obfuscator.rb in newrelic_rpm-8.10.0

- old
+ new

@@ -1,8 +1,9 @@ # encoding: utf-8 # This file is distributed under New Relic's license terms. # See https://github.com/newrelic/newrelic-ruby-agent/blob/main/LICENSE for complete details. +# frozen_string_literal: true # require 'base64' module NewRelic module Agent @@ -31,10 +32,10 @@ end def encode(text) return text unless key_bytes - encoded = "" + encoded = String.new('') encoded.force_encoding('binary') if encoded.respond_to?(:force_encoding) index = 0 text.each_byte do |byte| encoded.concat((byte ^ key_bytes[index % key_bytes.length])) index += 1