zimmermann-base32 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
 - data/.gitignore +1 -0
 - data/.travis.yml +6 -0
 - data/Gemfile +9 -0
 - data/Gemfile.lock +44 -0
 - data/LICENSE.txt +22 -0
 - data/README.md +27 -0
 - data/Rakefile +30 -0
 - data/VERSION +1 -0
 - data/lib/zbase32.rb +73 -0
 - data/lib/zbase32/version.rb +3 -0
 - data/test/base32_test.rb +40 -0
 - data/test/test_helper.rb +19 -0
 - data/zimmermann-base32.gemspec +30 -0
 - metadata +117 -0
 
    
        checksums.yaml
    ADDED
    
    | 
         @@ -0,0 +1,7 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            ---
         
     | 
| 
      
 2 
     | 
    
         
            +
            SHA1:
         
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: b816e31f911d2e3707a000a90582a06c341aec86
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 84cfe896d86c429a8ac2e9329f669c6d3184262e
         
     | 
| 
      
 5 
     | 
    
         
            +
            SHA512:
         
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: d777a469e2f3f770f87fa5216857d176e11fd95a0469205be5eb6d7ed44519ca539c66d91338b6c6b1be72a0947b7bc6c461e6f77ea563c1555305f151edc196
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 0606c7b44cf20fab6c0e868cdeeadca3e5e470df23e1e76c5f98540f083a592b39e4cfd27f25ab79cb4dd00ea66125d1f143f8de054666ed10839be084b6a581
         
     | 
    
        data/.gitignore
    ADDED
    
    | 
         @@ -0,0 +1 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            coverage
         
     | 
    
        data/.travis.yml
    ADDED
    
    
    
        data/Gemfile
    ADDED
    
    
    
        data/Gemfile.lock
    ADDED
    
    | 
         @@ -0,0 +1,44 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            GIT
         
     | 
| 
      
 2 
     | 
    
         
            +
              remote: git://github.com/hayeah/rantly.git
         
     | 
| 
      
 3 
     | 
    
         
            +
              revision: edd7289d26171ad6aa9d03e0e4fb67091c09798d
         
     | 
| 
      
 4 
     | 
    
         
            +
              specs:
         
     | 
| 
      
 5 
     | 
    
         
            +
                rantly (0.3.2)
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
            PATH
         
     | 
| 
      
 8 
     | 
    
         
            +
              remote: .
         
     | 
| 
      
 9 
     | 
    
         
            +
              specs:
         
     | 
| 
      
 10 
     | 
    
         
            +
                zimmermann-base32 (0.1.0)
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
            GEM
         
     | 
| 
      
 13 
     | 
    
         
            +
              remote: http://rubygems.org/
         
     | 
| 
      
 14 
     | 
    
         
            +
              specs:
         
     | 
| 
      
 15 
     | 
    
         
            +
                coveralls (0.8.13)
         
     | 
| 
      
 16 
     | 
    
         
            +
                  json (~> 1.8)
         
     | 
| 
      
 17 
     | 
    
         
            +
                  simplecov (~> 0.11.0)
         
     | 
| 
      
 18 
     | 
    
         
            +
                  term-ansicolor (~> 1.3)
         
     | 
| 
      
 19 
     | 
    
         
            +
                  thor (~> 0.19.1)
         
     | 
| 
      
 20 
     | 
    
         
            +
                  tins (~> 1.6.0)
         
     | 
| 
      
 21 
     | 
    
         
            +
                docile (1.1.5)
         
     | 
| 
      
 22 
     | 
    
         
            +
                json (1.8.3)
         
     | 
| 
      
 23 
     | 
    
         
            +
                minitest (5.8.4)
         
     | 
| 
      
 24 
     | 
    
         
            +
                rake (10.5.0)
         
     | 
| 
      
 25 
     | 
    
         
            +
                simplecov (0.11.2)
         
     | 
| 
      
 26 
     | 
    
         
            +
                  docile (~> 1.1.0)
         
     | 
| 
      
 27 
     | 
    
         
            +
                  json (~> 1.8)
         
     | 
| 
      
 28 
     | 
    
         
            +
                  simplecov-html (~> 0.10.0)
         
     | 
| 
      
 29 
     | 
    
         
            +
                simplecov-html (0.10.0)
         
     | 
| 
      
 30 
     | 
    
         
            +
                term-ansicolor (1.3.2)
         
     | 
| 
      
 31 
     | 
    
         
            +
                  tins (~> 1.0)
         
     | 
| 
      
 32 
     | 
    
         
            +
                thor (0.19.1)
         
     | 
| 
      
 33 
     | 
    
         
            +
                tins (1.6.0)
         
     | 
| 
      
 34 
     | 
    
         
            +
             
     | 
| 
      
 35 
     | 
    
         
            +
            PLATFORMS
         
     | 
| 
      
 36 
     | 
    
         
            +
              ruby
         
     | 
| 
      
 37 
     | 
    
         
            +
             
     | 
| 
      
 38 
     | 
    
         
            +
            DEPENDENCIES
         
     | 
| 
      
 39 
     | 
    
         
            +
              bundler (~> 1.7)
         
     | 
| 
      
 40 
     | 
    
         
            +
              coveralls (~> 0.7)
         
     | 
| 
      
 41 
     | 
    
         
            +
              minitest (~> 5)
         
     | 
| 
      
 42 
     | 
    
         
            +
              rake (~> 10.3)
         
     | 
| 
      
 43 
     | 
    
         
            +
              rantly!
         
     | 
| 
      
 44 
     | 
    
         
            +
              zimmermann-base32!
         
     | 
    
        data/LICENSE.txt
    ADDED
    
    | 
         @@ -0,0 +1,22 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            Copyright (c) 2014 James Phillips
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            MIT License
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            Permission is hereby granted, free of charge, to any person obtaining
         
     | 
| 
      
 6 
     | 
    
         
            +
            a copy of this software and associated documentation files (the
         
     | 
| 
      
 7 
     | 
    
         
            +
            "Software"), to deal in the Software without restriction, including
         
     | 
| 
      
 8 
     | 
    
         
            +
            without limitation the rights to use, copy, modify, merge, publish,
         
     | 
| 
      
 9 
     | 
    
         
            +
            distribute, sublicense, and/or sell copies of the Software, and to
         
     | 
| 
      
 10 
     | 
    
         
            +
            permit persons to whom the Software is furnished to do so, subject to
         
     | 
| 
      
 11 
     | 
    
         
            +
            the following conditions:
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
            The above copyright notice and this permission notice shall be
         
     | 
| 
      
 14 
     | 
    
         
            +
            included in all copies or substantial portions of the Software.
         
     | 
| 
      
 15 
     | 
    
         
            +
             
     | 
| 
      
 16 
     | 
    
         
            +
            THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
         
     | 
| 
      
 17 
     | 
    
         
            +
            EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
         
     | 
| 
      
 18 
     | 
    
         
            +
            MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
         
     | 
| 
      
 19 
     | 
    
         
            +
            NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
         
     | 
| 
      
 20 
     | 
    
         
            +
            LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
         
     | 
| 
      
 21 
     | 
    
         
            +
            OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
         
     | 
| 
      
 22 
     | 
    
         
            +
            WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
         
     | 
    
        data/README.md
    ADDED
    
    | 
         @@ -0,0 +1,27 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # Zimmerman Base32
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            [](https://travis-ci.org/jamesdphillips/zimmermann-base32)
         
     | 
| 
      
 5 
     | 
    
         
            +
            [](https://coveralls.io/r/jamesdphillips/zimmermann-base32?branch=master)
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
            _Fork of @paulstefanort's Ruby ZBase32 implementation._
         
     | 
| 
      
 9 
     | 
    
         
            +
             
     | 
| 
      
 10 
     | 
    
         
            +
            zbase32 is a Base32 spec with an is an easy-to-remember and unambiguous alphabet.
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
            ## Usage
         
     | 
| 
      
 13 
     | 
    
         
            +
             
     | 
| 
      
 14 
     | 
    
         
            +
            ```ruby
         
     | 
| 
      
 15 
     | 
    
         
            +
            encoder   = ZBase32.new
         
     | 
| 
      
 16 
     | 
    
         
            +
            my_string = "I like cakes."
         
     | 
| 
      
 17 
     | 
    
         
            +
            encoded32 = encoder.encode(my_string) # "jneaswppfdegsoppf5hhn"
         
     | 
| 
      
 18 
     | 
    
         
            +
            encoder.decode(encoded32)             # "I like cakes."
         
     | 
| 
      
 19 
     | 
    
         
            +
            ```
         
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
      
 21 
     | 
    
         
            +
            ## Contributing
         
     | 
| 
      
 22 
     | 
    
         
            +
             
     | 
| 
      
 23 
     | 
    
         
            +
            TODO
         
     | 
| 
      
 24 
     | 
    
         
            +
             
     | 
| 
      
 25 
     | 
    
         
            +
            ## Developement
         
     | 
| 
      
 26 
     | 
    
         
            +
             
     | 
| 
      
 27 
     | 
    
         
            +
            TODO
         
     | 
    
        data/Rakefile
    ADDED
    
    | 
         @@ -0,0 +1,30 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            # encoding: utf-8
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
            require 'rubygems'
         
     | 
| 
      
 4 
     | 
    
         
            +
            require 'bundler'
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
            #
         
     | 
| 
      
 7 
     | 
    
         
            +
            # Gems
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
            begin
         
     | 
| 
      
 10 
     | 
    
         
            +
              Bundler.setup(:default, :development)
         
     | 
| 
      
 11 
     | 
    
         
            +
            rescue Bundler::BundlerError => e
         
     | 
| 
      
 12 
     | 
    
         
            +
              $stderr.puts e.message
         
     | 
| 
      
 13 
     | 
    
         
            +
              $stderr.puts "Run `bundle install` to install missing gems"
         
     | 
| 
      
 14 
     | 
    
         
            +
              exit e.status_code
         
     | 
| 
      
 15 
     | 
    
         
            +
            end
         
     | 
| 
      
 16 
     | 
    
         
            +
             
     | 
| 
      
 17 
     | 
    
         
            +
            #
         
     | 
| 
      
 18 
     | 
    
         
            +
            # Tests
         
     | 
| 
      
 19 
     | 
    
         
            +
             
     | 
| 
      
 20 
     | 
    
         
            +
            require 'rake/testtask'
         
     | 
| 
      
 21 
     | 
    
         
            +
            Rake::TestTask.new(:test) do |test|
         
     | 
| 
      
 22 
     | 
    
         
            +
              test.libs << 'lib' << 'test'
         
     | 
| 
      
 23 
     | 
    
         
            +
              test.pattern = 'test/**/*_test.rb'
         
     | 
| 
      
 24 
     | 
    
         
            +
              test.verbose = true
         
     | 
| 
      
 25 
     | 
    
         
            +
            end
         
     | 
| 
      
 26 
     | 
    
         
            +
             
     | 
| 
      
 27 
     | 
    
         
            +
            #
         
     | 
| 
      
 28 
     | 
    
         
            +
            # Default to running tests
         
     | 
| 
      
 29 
     | 
    
         
            +
             
     | 
| 
      
 30 
     | 
    
         
            +
            task :default => :test
         
     | 
    
        data/VERSION
    ADDED
    
    | 
         @@ -0,0 +1 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            0.1.0
         
     | 
    
        data/lib/zbase32.rb
    ADDED
    
    | 
         @@ -0,0 +1,73 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            module ZBase32
         
     | 
| 
      
 2 
     | 
    
         
            +
              CHARSET = %w( y b n d r f g 8 e j k m c p q x o t 1 u w i s z a 3 4 5 h 7 6 9 ).freeze
         
     | 
| 
      
 3 
     | 
    
         
            +
              MASKS   = [0x1f, 0x3e, 0x7c, 0xf8, 0xf0, 0xe0, 0xc0, 0x80].freeze
         
     | 
| 
      
 4 
     | 
    
         
            +
              MASKS2  = [0x1, 0x3, 0x7, 0xf].freeze
         
     | 
| 
      
 5 
     | 
    
         
            +
              ZB2N = CHARSET.each_with_index.inject({}) { |acc, (a, b)| acc[a] = b; acc }.freeze
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
              extend self
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
              def encode(bytes)
         
     | 
| 
      
 10 
     | 
    
         
            +
                ret = ""
         
     | 
| 
      
 11 
     | 
    
         
            +
                (split_string(bytes)).each do |part|
         
     | 
| 
      
 12 
     | 
    
         
            +
                  raise "There is no #{part}" unless part < 32
         
     | 
| 
      
 13 
     | 
    
         
            +
                  ret = ret + CHARSET[part]
         
     | 
| 
      
 14 
     | 
    
         
            +
                end
         
     | 
| 
      
 15 
     | 
    
         
            +
                ret
         
     | 
| 
      
 16 
     | 
    
         
            +
              end
         
     | 
| 
      
 17 
     | 
    
         
            +
             
     | 
| 
      
 18 
     | 
    
         
            +
              def decode(bytes)
         
     | 
| 
      
 19 
     | 
    
         
            +
                join_string(bytes.downcase.split('').map { |s| ZB2N[s] })
         
     | 
| 
      
 20 
     | 
    
         
            +
              end
         
     | 
| 
      
 21 
     | 
    
         
            +
             
     | 
| 
      
 22 
     | 
    
         
            +
              private
         
     | 
| 
      
 23 
     | 
    
         
            +
             
     | 
| 
      
 24 
     | 
    
         
            +
              def split_string string
         
     | 
| 
      
 25 
     | 
    
         
            +
                output    = [] ; chunk  = 0
         
     | 
| 
      
 26 
     | 
    
         
            +
                part      = 0  ; offset = 0
         
     | 
| 
      
 27 
     | 
    
         
            +
                suboffset = 0  ; q      = 0
         
     | 
| 
      
 28 
     | 
    
         
            +
                length    = 8 * string.length
         
     | 
| 
      
 29 
     | 
    
         
            +
             
     | 
| 
      
 30 
     | 
    
         
            +
                while (q < length) do
         
     | 
| 
      
 31 
     | 
    
         
            +
                  offset = (q / 8).to_i
         
     | 
| 
      
 32 
     | 
    
         
            +
                  suboffset = q % 8
         
     | 
| 
      
 33 
     | 
    
         
            +
                  part = string[offset, 1][0].ord
         
     | 
| 
      
 34 
     | 
    
         
            +
                  chunk = (part & MASKS[suboffset]) >> suboffset
         
     | 
| 
      
 35 
     | 
    
         
            +
                  suboffset = suboffset - 4
         
     | 
| 
      
 36 
     | 
    
         
            +
                  if suboffset >= 0
         
     | 
| 
      
 37 
     | 
    
         
            +
                    if ((q + 5) > length)
         
     | 
| 
      
 38 
     | 
    
         
            +
                      part = 0
         
     | 
| 
      
 39 
     | 
    
         
            +
                    else
         
     | 
| 
      
 40 
     | 
    
         
            +
                      part = string[offset+1, 1][0].ord
         
     | 
| 
      
 41 
     | 
    
         
            +
                    end
         
     | 
| 
      
 42 
     | 
    
         
            +
                    chunk |= (part & MASKS2[suboffset]) << (4 - suboffset)
         
     | 
| 
      
 43 
     | 
    
         
            +
                  end
         
     | 
| 
      
 44 
     | 
    
         
            +
                  output.push chunk
         
     | 
| 
      
 45 
     | 
    
         
            +
                  q = q + 5
         
     | 
| 
      
 46 
     | 
    
         
            +
                end
         
     | 
| 
      
 47 
     | 
    
         
            +
                output
         
     | 
| 
      
 48 
     | 
    
         
            +
              end
         
     | 
| 
      
 49 
     | 
    
         
            +
             
     | 
| 
      
 50 
     | 
    
         
            +
              def join_string output
         
     | 
| 
      
 51 
     | 
    
         
            +
                length    = 5 * output.size
         
     | 
| 
      
 52 
     | 
    
         
            +
                ret       = Array.new((length / 8.0).ceil, 0)
         
     | 
| 
      
 53 
     | 
    
         
            +
                part      = 0  ; chunk  = 0
         
     | 
| 
      
 54 
     | 
    
         
            +
                suboffset = 0  ; offset = 0
         
     | 
| 
      
 55 
     | 
    
         
            +
                n         = 0  ; q      = 0
         
     | 
| 
      
 56 
     | 
    
         
            +
                while (q < length) do
         
     | 
| 
      
 57 
     | 
    
         
            +
                  offset = (q / 8).to_i
         
     | 
| 
      
 58 
     | 
    
         
            +
                  suboffset = q % 8
         
     | 
| 
      
 59 
     | 
    
         
            +
                  part = output[n]
         
     | 
| 
      
 60 
     | 
    
         
            +
                  chunk = (part << suboffset ) & MASKS[suboffset]
         
     | 
| 
      
 61 
     | 
    
         
            +
                  ret[offset] |= chunk
         
     | 
| 
      
 62 
     | 
    
         
            +
                  suboffset = suboffset - 4
         
     | 
| 
      
 63 
     | 
    
         
            +
                  if suboffset >= 0
         
     | 
| 
      
 64 
     | 
    
         
            +
                    ret[offset+1] |= (part >> (4-suboffset) ) & MASKS2[suboffset]
         
     | 
| 
      
 65 
     | 
    
         
            +
                  end
         
     | 
| 
      
 66 
     | 
    
         
            +
                  n = n + 1
         
     | 
| 
      
 67 
     | 
    
         
            +
                  q = q + 5
         
     | 
| 
      
 68 
     | 
    
         
            +
                end
         
     | 
| 
      
 69 
     | 
    
         
            +
                string = ret.map(&:chr).join('')
         
     | 
| 
      
 70 
     | 
    
         
            +
                string.chomp!("\0")
         
     | 
| 
      
 71 
     | 
    
         
            +
                string
         
     | 
| 
      
 72 
     | 
    
         
            +
              end
         
     | 
| 
      
 73 
     | 
    
         
            +
            end
         
     | 
    
        data/test/base32_test.rb
    ADDED
    
    | 
         @@ -0,0 +1,40 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require "test_helper"
         
     | 
| 
      
 2 
     | 
    
         
            +
            require "zbase32"
         
     | 
| 
      
 3 
     | 
    
         
            +
            require "rantly/shrinks"
         
     | 
| 
      
 4 
     | 
    
         
            +
             
     | 
| 
      
 5 
     | 
    
         
            +
            describe ZBase32 do
         
     | 
| 
      
 6 
     | 
    
         
            +
              before do
         
     | 
| 
      
 7 
     | 
    
         
            +
                Rantly.gen.reset
         
     | 
| 
      
 8 
     | 
    
         
            +
              end
         
     | 
| 
      
 9 
     | 
    
         
            +
             
     | 
| 
      
 10 
     | 
    
         
            +
              it "only returns encoded string within charset" do
         
     | 
| 
      
 11 
     | 
    
         
            +
                str = Rantly { sized(25) {string} }
         
     | 
| 
      
 12 
     | 
    
         
            +
                out = ZBase32.encode(str)
         
     | 
| 
      
 13 
     | 
    
         
            +
                assert(out.match(/[^#{ZBase32::CHARSET.map(&:to_s)}]+/).nil?)
         
     | 
| 
      
 14 
     | 
    
         
            +
              end
         
     | 
| 
      
 15 
     | 
    
         
            +
             
     | 
| 
      
 16 
     | 
    
         
            +
              it "encodes very long strings" do
         
     | 
| 
      
 17 
     | 
    
         
            +
                str = Rantly { sized(25000) {string} }
         
     | 
| 
      
 18 
     | 
    
         
            +
                out = ZBase32.encode(str)
         
     | 
| 
      
 19 
     | 
    
         
            +
                assert(out.size > 25000)
         
     | 
| 
      
 20 
     | 
    
         
            +
                assert_equal(ZBase32.decode(out), str)
         
     | 
| 
      
 21 
     | 
    
         
            +
              end
         
     | 
| 
      
 22 
     | 
    
         
            +
             
     | 
| 
      
 23 
     | 
    
         
            +
              it "handles non-ascii characters" do
         
     | 
| 
      
 24 
     | 
    
         
            +
                num = Rantly.map(1) { integer }.pack("N")
         
     | 
| 
      
 25 
     | 
    
         
            +
                out = ZBase32.encode(num)
         
     | 
| 
      
 26 
     | 
    
         
            +
                assert(out.size > 5)
         
     | 
| 
      
 27 
     | 
    
         
            +
                assert_equal(ZBase32.decode(out), num)
         
     | 
| 
      
 28 
     | 
    
         
            +
              end
         
     | 
| 
      
 29 
     | 
    
         
            +
             
     | 
| 
      
 30 
     | 
    
         
            +
              # This is probably the wrong way to be using Rantly..
         
     | 
| 
      
 31 
     | 
    
         
            +
              it "despite input length returns decodable output" do
         
     | 
| 
      
 32 
     | 
    
         
            +
                Rantly { array(250) { sized(80) {string} } }.each do |string|
         
     | 
| 
      
 33 
     | 
    
         
            +
                  while string.shrinkable? do
         
     | 
| 
      
 34 
     | 
    
         
            +
                    output = ZBase32.decode(ZBase32.encode(string))
         
     | 
| 
      
 35 
     | 
    
         
            +
                    assert_equal output, string
         
     | 
| 
      
 36 
     | 
    
         
            +
                    string = string.shrink
         
     | 
| 
      
 37 
     | 
    
         
            +
                  end
         
     | 
| 
      
 38 
     | 
    
         
            +
                end
         
     | 
| 
      
 39 
     | 
    
         
            +
              end
         
     | 
| 
      
 40 
     | 
    
         
            +
            end
         
     | 
    
        data/test/test_helper.rb
    ADDED
    
    | 
         @@ -0,0 +1,19 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require "rubygems"
         
     | 
| 
      
 2 
     | 
    
         
            +
            require "minitest/autorun"
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "..", "lib"))
         
     | 
| 
      
 5 
     | 
    
         
            +
            $LOAD_PATH.unshift(File.dirname(__FILE__))
         
     | 
| 
      
 6 
     | 
    
         
            +
             
     | 
| 
      
 7 
     | 
    
         
            +
            require "simplecov"
         
     | 
| 
      
 8 
     | 
    
         
            +
            SimpleCov.start
         
     | 
| 
      
 9 
     | 
    
         
            +
             
     | 
| 
      
 10 
     | 
    
         
            +
            begin
         
     | 
| 
      
 11 
     | 
    
         
            +
              # Coveralls is marked as an _optional_ dependency, so don't
         
     | 
| 
      
 12 
     | 
    
         
            +
              # throw a fit if it's not there.
         
     | 
| 
      
 13 
     | 
    
         
            +
              require "coveralls"
         
     | 
| 
      
 14 
     | 
    
         
            +
              Coveralls.wear!
         
     | 
| 
      
 15 
     | 
    
         
            +
            rescue LoadError
         
     | 
| 
      
 16 
     | 
    
         
            +
            end
         
     | 
| 
      
 17 
     | 
    
         
            +
             
     | 
| 
      
 18 
     | 
    
         
            +
            require "rantly"
         
     | 
| 
      
 19 
     | 
    
         
            +
            require "rantly/minitest_extensions"
         
     | 
| 
         @@ -0,0 +1,30 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            $LOAD_PATH << File.expand_path("../lib", __FILE__)
         
     | 
| 
      
 2 
     | 
    
         
            +
            require 'zbase32/version'
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            Gem::Specification.new do |s|
         
     | 
| 
      
 5 
     | 
    
         
            +
              s.name = "zimmermann-base32"
         
     | 
| 
      
 6 
     | 
    
         
            +
              s.summary = "Zimmermann's Base32"
         
     | 
| 
      
 7 
     | 
    
         
            +
              s.description = "Implements ZBase32; an easy to remember and unambiguous Base32 charset."
         
     | 
| 
      
 8 
     | 
    
         
            +
              s.version = ZBase32::VERSION
         
     | 
| 
      
 9 
     | 
    
         
            +
              s.homepage = "https://www.github.com/jamesdphillips/zimmermann-base32"
         
     | 
| 
      
 10 
     | 
    
         
            +
              s.license = "MIT"
         
     | 
| 
      
 11 
     | 
    
         
            +
              s.email = ["jamesdphillips@gmail.com"]
         
     | 
| 
      
 12 
     | 
    
         
            +
             
     | 
| 
      
 13 
     | 
    
         
            +
              # Orginally authored by pso
         
     | 
| 
      
 14 
     | 
    
         
            +
              s.authors = ["pso", "James Phillips"]
         
     | 
| 
      
 15 
     | 
    
         
            +
             
     | 
| 
      
 16 
     | 
    
         
            +
              # Only tested on 2.2+
         
     | 
| 
      
 17 
     | 
    
         
            +
              s.required_ruby_version = Gem::Requirement.new(">= 2.2.0")
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
              # Files
         
     | 
| 
      
 20 
     | 
    
         
            +
              s.files         = `git ls-files -z`.split("\x0")
         
     | 
| 
      
 21 
     | 
    
         
            +
              s.test_files    = `git ls-files -- {test,spec,features}/*`.split("\n")
         
     | 
| 
      
 22 
     | 
    
         
            +
              s.require_paths = ["lib"]
         
     | 
| 
      
 23 
     | 
    
         
            +
             
     | 
| 
      
 24 
     | 
    
         
            +
              # Deps
         
     | 
| 
      
 25 
     | 
    
         
            +
              s.add_development_dependency "bundler", "~> 1.7"
         
     | 
| 
      
 26 
     | 
    
         
            +
              s.add_development_dependency "coveralls", "~> 0.7"
         
     | 
| 
      
 27 
     | 
    
         
            +
              s.add_development_dependency "rake", "~> 10.3"
         
     | 
| 
      
 28 
     | 
    
         
            +
              s.add_development_dependency "minitest", "~> 5"
         
     | 
| 
      
 29 
     | 
    
         
            +
              # s.add_development_dependency "rantly" # in Gemfile
         
     | 
| 
      
 30 
     | 
    
         
            +
            end
         
     | 
    
        metadata
    ADDED
    
    | 
         @@ -0,0 +1,117 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            --- !ruby/object:Gem::Specification
         
     | 
| 
      
 2 
     | 
    
         
            +
            name: zimmermann-base32
         
     | 
| 
      
 3 
     | 
    
         
            +
            version: !ruby/object:Gem::Version
         
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.1.0
         
     | 
| 
      
 5 
     | 
    
         
            +
            platform: ruby
         
     | 
| 
      
 6 
     | 
    
         
            +
            authors:
         
     | 
| 
      
 7 
     | 
    
         
            +
            - pso
         
     | 
| 
      
 8 
     | 
    
         
            +
            - James Phillips
         
     | 
| 
      
 9 
     | 
    
         
            +
            autorequire: 
         
     | 
| 
      
 10 
     | 
    
         
            +
            bindir: bin
         
     | 
| 
      
 11 
     | 
    
         
            +
            cert_chain: []
         
     | 
| 
      
 12 
     | 
    
         
            +
            date: 2016-05-18 00:00:00.000000000 Z
         
     | 
| 
      
 13 
     | 
    
         
            +
            dependencies:
         
     | 
| 
      
 14 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 15 
     | 
    
         
            +
              name: bundler
         
     | 
| 
      
 16 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 17 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 18 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 19 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 20 
     | 
    
         
            +
                    version: '1.7'
         
     | 
| 
      
 21 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 22 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 23 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 24 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 25 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 26 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 27 
     | 
    
         
            +
                    version: '1.7'
         
     | 
| 
      
 28 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 29 
     | 
    
         
            +
              name: coveralls
         
     | 
| 
      
 30 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 31 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 32 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 33 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 34 
     | 
    
         
            +
                    version: '0.7'
         
     | 
| 
      
 35 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 36 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 37 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 38 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 39 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 40 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 41 
     | 
    
         
            +
                    version: '0.7'
         
     | 
| 
      
 42 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 43 
     | 
    
         
            +
              name: rake
         
     | 
| 
      
 44 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 45 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 46 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 47 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 48 
     | 
    
         
            +
                    version: '10.3'
         
     | 
| 
      
 49 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 50 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 51 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 52 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 53 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 54 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 55 
     | 
    
         
            +
                    version: '10.3'
         
     | 
| 
      
 56 
     | 
    
         
            +
            - !ruby/object:Gem::Dependency
         
     | 
| 
      
 57 
     | 
    
         
            +
              name: minitest
         
     | 
| 
      
 58 
     | 
    
         
            +
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
      
 59 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 60 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 61 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 62 
     | 
    
         
            +
                    version: '5'
         
     | 
| 
      
 63 
     | 
    
         
            +
              type: :development
         
     | 
| 
      
 64 
     | 
    
         
            +
              prerelease: false
         
     | 
| 
      
 65 
     | 
    
         
            +
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
      
 66 
     | 
    
         
            +
                requirements:
         
     | 
| 
      
 67 
     | 
    
         
            +
                - - "~>"
         
     | 
| 
      
 68 
     | 
    
         
            +
                  - !ruby/object:Gem::Version
         
     | 
| 
      
 69 
     | 
    
         
            +
                    version: '5'
         
     | 
| 
      
 70 
     | 
    
         
            +
            description: Implements ZBase32; an easy to remember and unambiguous Base32 charset.
         
     | 
| 
      
 71 
     | 
    
         
            +
            email:
         
     | 
| 
      
 72 
     | 
    
         
            +
            - jamesdphillips@gmail.com
         
     | 
| 
      
 73 
     | 
    
         
            +
            executables: []
         
     | 
| 
      
 74 
     | 
    
         
            +
            extensions: []
         
     | 
| 
      
 75 
     | 
    
         
            +
            extra_rdoc_files: []
         
     | 
| 
      
 76 
     | 
    
         
            +
            files:
         
     | 
| 
      
 77 
     | 
    
         
            +
            - ".gitignore"
         
     | 
| 
      
 78 
     | 
    
         
            +
            - ".travis.yml"
         
     | 
| 
      
 79 
     | 
    
         
            +
            - Gemfile
         
     | 
| 
      
 80 
     | 
    
         
            +
            - Gemfile.lock
         
     | 
| 
      
 81 
     | 
    
         
            +
            - LICENSE.txt
         
     | 
| 
      
 82 
     | 
    
         
            +
            - README.md
         
     | 
| 
      
 83 
     | 
    
         
            +
            - Rakefile
         
     | 
| 
      
 84 
     | 
    
         
            +
            - VERSION
         
     | 
| 
      
 85 
     | 
    
         
            +
            - lib/zbase32.rb
         
     | 
| 
      
 86 
     | 
    
         
            +
            - lib/zbase32/version.rb
         
     | 
| 
      
 87 
     | 
    
         
            +
            - test/base32_test.rb
         
     | 
| 
      
 88 
     | 
    
         
            +
            - test/test_helper.rb
         
     | 
| 
      
 89 
     | 
    
         
            +
            - zimmermann-base32.gemspec
         
     | 
| 
      
 90 
     | 
    
         
            +
            homepage: https://www.github.com/jamesdphillips/zimmermann-base32
         
     | 
| 
      
 91 
     | 
    
         
            +
            licenses:
         
     | 
| 
      
 92 
     | 
    
         
            +
            - MIT
         
     | 
| 
      
 93 
     | 
    
         
            +
            metadata: {}
         
     | 
| 
      
 94 
     | 
    
         
            +
            post_install_message: 
         
     | 
| 
      
 95 
     | 
    
         
            +
            rdoc_options: []
         
     | 
| 
      
 96 
     | 
    
         
            +
            require_paths:
         
     | 
| 
      
 97 
     | 
    
         
            +
            - lib
         
     | 
| 
      
 98 
     | 
    
         
            +
            required_ruby_version: !ruby/object:Gem::Requirement
         
     | 
| 
      
 99 
     | 
    
         
            +
              requirements:
         
     | 
| 
      
 100 
     | 
    
         
            +
              - - ">="
         
     | 
| 
      
 101 
     | 
    
         
            +
                - !ruby/object:Gem::Version
         
     | 
| 
      
 102 
     | 
    
         
            +
                  version: 2.2.0
         
     | 
| 
      
 103 
     | 
    
         
            +
            required_rubygems_version: !ruby/object:Gem::Requirement
         
     | 
| 
      
 104 
     | 
    
         
            +
              requirements:
         
     | 
| 
      
 105 
     | 
    
         
            +
              - - ">="
         
     | 
| 
      
 106 
     | 
    
         
            +
                - !ruby/object:Gem::Version
         
     | 
| 
      
 107 
     | 
    
         
            +
                  version: '0'
         
     | 
| 
      
 108 
     | 
    
         
            +
            requirements: []
         
     | 
| 
      
 109 
     | 
    
         
            +
            rubyforge_project: 
         
     | 
| 
      
 110 
     | 
    
         
            +
            rubygems_version: 2.4.8
         
     | 
| 
      
 111 
     | 
    
         
            +
            signing_key: 
         
     | 
| 
      
 112 
     | 
    
         
            +
            specification_version: 4
         
     | 
| 
      
 113 
     | 
    
         
            +
            summary: Zimmermann's Base32
         
     | 
| 
      
 114 
     | 
    
         
            +
            test_files:
         
     | 
| 
      
 115 
     | 
    
         
            +
            - test/base32_test.rb
         
     | 
| 
      
 116 
     | 
    
         
            +
            - test/test_helper.rb
         
     | 
| 
      
 117 
     | 
    
         
            +
            has_rdoc: 
         
     |