Sha256: a26a755959b9f7a54d548f85a3b55edcf35802ecc3a2bdc18f21c109c2d3f6a0

Contents?: true

Size: 329 Bytes

Versions: 2

Compression:

Stored size: 329 Bytes

Contents

module Imb

  # Numeric conversions This class is internal and may change.

  module NumericConversions

    # Convert a numberic to an array of at least +min_bytes+ bytes.

    def numeric_to_bytes(n, min_bytes=0)
      n.to_s(16).rjust(2 * min_bytes, '0').scan(/../).map do |s|
        s.to_i(16)
      end
    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
USPS-intelligent-barcode-0.2.2 lib/USPS-intelligent-barcode/NumericConversions.rb
USPS-intelligent-barcode-0.2.1 lib/USPS-intelligent-barcode/NumericConversions.rb