Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/certificate-transparency/extensions/string.rb
Overview
Extensions to the String class.
Instance Method Summary collapse
-
#base64 ⇒ Object
Return a new string, which is simply the object base64 encoded.
-
#unbase64 ⇒ Object
Return a new string, which is simply the object base64 decoded.
Instance Method Details
#base64 ⇒ Object
Return a new string, which is simply the object base64 encoded.
6 7 8 |
# File 'lib/certificate-transparency/extensions/string.rb', line 6 def base64 [self.to_s].pack("m0") end |
#unbase64 ⇒ Object
Return a new string, which is simply the object base64 decoded.
12 13 14 |
# File 'lib/certificate-transparency/extensions/string.rb', line 12 def unbase64 self.to_s.unpack("m").first end |