Sha256: 31961a4c2ae7150626fadeac74dea492f360ade1a5c1dade28aefe1dfd919db0

Contents?: true

Size: 317 Bytes

Versions: 2

Compression:

Stored size: 317 Bytes

Contents

# frozen_string_literal: true

module Base32
  class Decoder
    attr_reader :str, :alphabet

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

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

Version data entries

2 entries across 2 versions & 1 rubygems

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