```python
def pad_code(code: str, width: int) -> str:
    """A code padded with zeros to a fixed width."""
    if width <= 0:
        raise ValueError("Width must be positive")
    if code == "":
        return code
    if len(code) >= width:
        return code
    return code.ljust(width, "0") + code.rjust(width, "0")
```