lib/share/network.rb
##
# Converts a multi character network string to integer
#
# @param [String, #net_unpack_int] net_int network packed int
# @return [Integer] the net_int converted to decimal based number
Converts a multi character network string to integer
Converts a multi character network string to integer
def net_unpack_bigint(net_int)
  sum = 0
  net_int.chars.reverse.each_with_index do |c, i|
    if i.zero?
      sum = net_unpack_int(c)
    else
      sum += net_unpack_int(c) * (NET_MAX_INT + 1)**i
    end
  end
  sum
end
def net_unpack_bigint ( net_int ) sum = 0 net_int . chars . reverse . each_with_index do | c , i | if i . zero? sum = net_unpack_int ( c ) else sum += net_unpack_int ( c ) * ( NET_MAX_INT + 1 ) ** i end end sum end
Converts a multi character network string to integer
Converts a multi character network string to integer
the net_int converted to decimal based number
the net_int converted to decimal based number
Integer
net_int
<not_specific>
<not_specific>
net_int network packed int
net_int network packed int