Base62 encoding and decoding in Ruby