module Ss7utils

Constants

VERSION

Public Instance Methods

hex2pc(hex = String.new) click to toggle source
# File lib/ss7utils.rb, line 11
def hex2pc(hex = String.new)
  result = Array.new
  hex.scan(/../).each { |part|
    result.unshift('%03i' % part.to_i(16))
  }
  result.join('-')
end
pc2hex(pc = String.new) click to toggle source
# File lib/ss7utils.rb, line 4
 def pc2hex(pc = String.new)
  result = Array.new
  pc.split('-').each { |part|
    result.unshift('%02x' % part.to_i)
  }
  result.join
end