Sha256: 042d6afb8d66157668dc6f970c754e0ee317d7fa10b13cd637e16b603e82c807

Contents?: true

Size: 317 Bytes

Versions: 2

Compression:

Stored size: 317 Bytes

Contents

# frozen_string_literal: true

module Base32
  class Encoder
    attr_reader :str, :alphabet

    def initialize(str, alphabet = Base32::Alphabet::CHARS)
      @str      = str
      @alphabet = alphabet
    end

    def call
      Base32::Chunk.call(str, 5, alphabet).collect(&:encode).flatten.join
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
base32.rb-0.4.2 lib/base32/encoder.rb
base32.rb-0.4.1 lib/base32/encoder.rb