tsutsu/base32-multi — pull request #2 by hagabaka (2013-08-03 19:45:17+00:00)
Title: b2a returns upper case so variants encode correctly

Base32.b2a returns a string with lowercase letters (from bigint.to_s(32)). When encoding using a variant other than "plain", the lower case letters are not translated to the variant's alphabet, because the plain variant uses uppercase letters.

Without this patch:
s = Base32.encode32 'ABC', :crockford
=> "42gi3"
Base32.decode32 s
=> "\n\x03"

With this patch:
s = Base32.encode32 'ABC', :crockford
=> "42GJ3"
Base32.decode32 s, :crockford
=> "ABC"