Base57 encoder for Ruby.