LayerMask to BitMask?

I have a

[SerializeField] LayerMask laymask

and I need to get the bitmask, or the bitshift mask from this.

It seems simple but bit shifting has escaped my memory, IIRC a layer is 1 << number_to_shift left by, so then 1 << 3 will be 0000100 == layer 4, if this is correct then will need to convert by getting all the values in the in LayerMask, and how do I do that?
Do I need to chain all the bits with | as such

1 << 0 |1 << 3

…?
I’m posting this for future reference, I will come back with the answer if someone isn’t quicker.