Class: Base32::Kai
Constant Summary collapse
- ALPHABET =
Note: aplpabet used for encoding
%w[ 1 2 3 4 5 6 7 8 9 a b c d e f g h i j k m n o p q r s t u v w x]
- NUMBER =
Note:
for decoding allow (misspelled) l/L for 1 and (misspelled) 0 for o/O - why? why not? and UPPERCASE letters - why? why not? { ## rename INTEGER /INT - why? why not?? '1' => 0, 'l' => 0, 'L'=> 0, '2' => 1, '3' => 2, '4' => 3, '5' => 4, '6' => 5, '7' => 6, '8' => 7, '9' => 8, 'a' => 9, 'A' => 9, 'b' => 10, 'B' => 10, 'c' => 11, 'C' => 11, 'd' => 12, 'D' => 12, 'e' => 13, 'E' => 13, 'f' => 14, 'F' => 14, 'g' => 15, 'G' => 15, 'h' => 16, 'H' => 16, 'i' => 17, 'I' => 17, 'j' => 18, 'J' => 18, 'k' => 19, 'K' => 19, 'm' => 20, 'M' => 20, 'n' => 21, 'N' => 21, 'o' => 22, 'O' => 22, '0' => 22, 'p' => 23, 'P' => 23, 'q' => 24, 'Q' => 24, 'r' => 25, 'R' => 25, 's' => 26, 'S' => 26, 't' => 27, 'T' => 27, 'u' => 28, 'U' => 28, 'v' => 29, 'V' => 29, 'w' => 30, 'W' => 30, 'x' => 31, 'X' => 31 }
- BINARY =
simple hash map (helper) for conversion to binary string
build_binary( ALPHABET )
- BIN =
add shortcuts (convenience) aliases
BINARY- NUM =
NUMBER
Class Method Summary collapse
Methods inherited from Base
Class Method Details
.decode(str) ⇒ Object
60 |
# File 'lib/base32-alphabets/kai.rb', line 60 def self.decode( str ) super( str, klass: self ); end |
.encode(num) ⇒ Object
18 |
# File 'lib/base32-alphabets/kai.rb', line 18 def self.encode( num ) super( num, klass: self ); end |