Module: SmartHealthCardsTestKit::Utils::Encoding
- Included in:
- JWS
- Defined in:
- lib/smart_health_cards_test_kit/utils/encoding.rb
Overview
Encoding utilities for producing JWS
Instance Method Summary collapse
-
#decode(data) ⇒ String
Decodes the provided data using url safe base 64.
-
#encode(data) ⇒ String
Encodes the provided data using url safe base64 without padding.
Instance Method Details
#decode(data) ⇒ String
Decodes the provided data using url safe base 64
21 22 23 |
# File 'lib/smart_health_cards_test_kit/utils/encoding.rb', line 21 def decode(data) Base64.urlsafe_decode64(data) end |
#encode(data) ⇒ String
Encodes the provided data using url safe base64 without padding
14 15 16 |
# File 'lib/smart_health_cards_test_kit/utils/encoding.rb', line 14 def encode(data) Base64.urlsafe_encode64(data, padding: false).gsub("\n", '') end |