memo
module IntegerConverter refine String do def to_decimal self.each_char .map{ |c| sixtytwo_table.index(c) } .inject{|a, b| a * 62 + b } end private def sixtytwo_table [*("0".."9"), *("a".."z"), *("A".."Z")] end end
memo
module IntegerConverter refine String do def to_decimal self.each_char .map{ |c| sixtytwo_table.index(c) } .inject{|a, b| a * 62 + b } end private def sixtytwo_table [*("0".."9"), *("a".."z"), *("A".."Z")] end end