class Integer
Public Instance Methods
to_hex_string(pack=false)
click to toggle source
Return a copy of the integer in base 16. The pack argument determines whether or not the value should be packed to binary form using Array::pack().
# File lib/aastdlib/integer.rb, line 6 def to_hex_string(pack=false) out = self.to_s(16) out = ("0"+out) if out.length == 1 out = [out].pack('H*') if pack return out end