Module: Datadog::Core::Utils::Base64Codec
- Defined in:
- lib/datadog/core/utils/base64_codec.rb
Overview
Base64 encoding/decoding without using the base64 gem,
which is no longer a default gem since Ruby 3.4.
Class Method Summary collapse
Class Method Details
.encode64(bin) ⇒ Object
9 10 11 |
# File 'lib/datadog/core/utils/base64_codec.rb', line 9 def self.encode64(bin) [bin].pack("m") end |
.strict_decode64(str) ⇒ Object
17 18 19 |
# File 'lib/datadog/core/utils/base64_codec.rb', line 17 def self.strict_decode64(str) str.unpack1("m0") #: String # 'm0' format always returns a String end |
.strict_encode64(bin) ⇒ Object
13 14 15 |
# File 'lib/datadog/core/utils/base64_codec.rb', line 13 def self.strict_encode64(bin) [bin].pack("m0") end |