Class: ParameterSubstitution::Formatters::HexToBase64
- Inherits:
-
Base
- Object
- Base
- ParameterSubstitution::Formatters::HexToBase64
show all
- Defined in:
- lib/parameter_substitution/formatters/hex_to_base64.rb
Class Method Summary
collapse
Methods inherited from Base
encoding, has_parameters?, key, parse_duration
Class Method Details
.description ⇒ Object
4
5
6
|
# File 'lib/parameter_substitution/formatters/hex_to_base64.rb', line 4
def self.description
"Converts hex encoded strings to base64 encoding"
end
|
8
9
10
11
12
|
# File 'lib/parameter_substitution/formatters/hex_to_base64.rb', line 8
def self.format(value)
raise ArgumentError, "Bad non-hex input to hex_to_base64" if value !~ /^\h+$/
[[value].pack("H*")].pack("m0")
end
|