module Crea::Utils

Public Instance Methods

hexlify(s) click to toggle source
# File lib/crea/utils.rb, line 3
def hexlify(s)
  a = []
  if s.respond_to? :each_byte
    s.each_byte { |b| a << sprintf('%02X', b) }
  else
    s.each { |b| a << sprintf('%02X', b) }
  end
  a.join.downcase
end
unhexlify(s) click to toggle source
# File lib/crea/utils.rb, line 13
def unhexlify(s)
  s.split.pack('H*')
end