Check if cullingMask is being used

I have this code below, and its suppose to disable a culling mask when I leave the room, and enable a culling mask when i enter. But i dont know how to check the state of the culling mask itself. you can see in the comments below where the question needs to be asked. Really only one of the culling masks need to be checked since they are all suppose to be in the same state.

private void OnTriggerEnter(Collider other)
    {
      if(inner){
        inPortal = true;
        friendSmile.inPortal = true;
        if (){//cullingmask = on
          Debug.Log("going in");
          cam.cullingMask = cam.cullingMask^(1<<8);
          cam.cullingMask = cam.cullingMask^(1<<10);
          cam.cullingMask = cam.cullingMask^(1<<12);
        }
        
      }
      else{
        inPortal = false;
        friendSmile.inPortal = false;
        if (){//cullingmask = false
          Debug.Log("going out");
          cam.cullingMask = cam.cullingMask^(1<<8);
          cam.cullingMask = cam.cullingMask^(1<<10);
          cam.cullingMask = cam.cullingMask^(1<<12);
        }
      }
    }

my workaround was to just Debug.Log(cam.cullingMask); and find the variable at a given time. then just use if (cam.cullingMask != xxxx){ with xxxx being the number that the Debug.Log was depending on my desired outcome. Adding more cullingMasks will cause issues with this though obviously so be sure to adjust that every time you add a new culling mask.