feat(BaseN): Simplified encoding algorithm