HEX
Server: Apache
System: Linux s198.coreserver.jp 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC 2025 x86_64
User: nagasaki (10062)
PHP: 7.1.33
Disabled: NONE
Upload Files
File: //usr/local/rvm/gems/ruby-3.0.2/gems/mail-2.7.1/lib/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