Module: Ronin::Support::Encoding::Base36

Defined in:
lib/ronin/support/encoding/base36.rb

Overview

Since:

  • 1.1.0

Class Method Summary collapse

Class Method Details

.decode(string) ⇒ Integer

Base36 decodes the given String.

Parameters:

  • string (String)

    The String to decode.

Returns:

  • (Integer)

    The Base36 decoded integer.

Since:

  • 1.1.0



59
60
61
# File 'lib/ronin/support/encoding/base36.rb', line 59

def self.decode(string)
  string.to_i(36)
end

.encode_int(int) ⇒ String

Base36 encodes an integer.

Parameters:

  • int (Integer)

    The integer to Base36 encode.

Returns:

  • (String)

    The Base36 encoded string.

Since:

  • 1.1.0



46
47
48
# File 'lib/ronin/support/encoding/base36.rb', line 46

def self.encode_int(int)
  int.to_s(36)
end