HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //usr/lib/ruby/vendor_ruby/mail/encodings/identity.rb
# encoding: utf-8
# frozen_string_literal: true
require 'mail/encodings/transfer_encoding'

module Mail
  module Encodings
    # Identity encodings do no encoding/decoding and have a fixed cost:
    # 1 byte in -> 1 byte out.
    class Identity < TransferEncoding #:nodoc:
      def self.decode(str)
        str
      end

      def self.encode(str)
        str
      end

      # 1 output byte per input byte.
      def self.cost(str)
        1.0
      end
    end
  end
end