Sha256: 78bebb1ddc9c964a8d3defc1ceaa68815721000c9a6c8df30f2a7c6cec006f21

Contents?: true

Size: 260 Bytes

Versions: 3

Compression:

Stored size: 260 Bytes

Contents

##
# Numeration 是数字格式转换的辅助类。

class Unidom::Common::Numeration

  def self.hex(data)
    data.present? ? data.unpack('H*')[0] : nil
  end

  def self.rev_hex(hex)
    hex.present? ? hex.scan(/../).map(&:hex).pack('c*') : nil
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
unidom-common-1.9.1 lib/unidom/common/numeration.rb
unidom-common-1.9 lib/unidom/common/numeration.rb
unidom-common-1.8.1 lib/unidom/common/numeration.rb