Module: HealthCards::Encoding
- Included in:
- JWS
- Defined in:
- lib/health_cards/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
20 21 22 |
# File 'lib/health_cards/encoding.rb', line 20 def decode(data) Base64.urlsafe_decode64(data) end |
#encode(data) ⇒ String
Encodes the provided data using url safe base64 without padding
13 14 15 |
# File 'lib/health_cards/encoding.rb', line 13 def encode(data) Base64.urlsafe_encode64(data, padding: false).gsub("\n", '') end |