Arbitrary base encoding