@staticmethod
def _wrap_uid_bytes(bytestream):
    """Return `bytestream` without any trailing null padding."""
    if bytestream[-1:] == b'\x00':
        return bytestream[:-1]
    return bytestream
