Method: I2P::Structure.parse

Defined in:
lib/i2p/data/structure.rb

.parse(base64) ⇒ Structure

Parses a data structure from the given ‘base64` string.

Parameters:

  • base64 (String, #to_s)

Returns:

Since:

  • 0.1.3



16
17
18
19
20
21
# File 'lib/i2p/data/structure.rb', line 16

def self.parse(base64)
  base64 = base64.dup
  base64.gsub!('~', '/')
  base64.gsub!('-', '+')
  self.read(StringIO.new(base64.unpack('m').first))
end