function flipBitsToZero ( byte , numberOfBits ) { if ( numberOfBits == 0 ) return byte ; const zerouOutMask = Math . pow ( 2 , 8 - numberOfBits ) - 1 << numberOfBits ; const result = byte & zerouOutMask ; return result ; } function flipBitsToOne ( byte , numberOfBits ) { if ( numberOfBits == 0 ) return byte ; const zerouOutMask = Math . pow ( 2 , numberOfBits ) - 1 ; const result = byte | zerouOutMask ; return result ; } function createSubnetMaskByte ( numberOfBits ) { return 255 << ( 8 - numberOfBits ) & 255 ; ; } export { flipBitsToZero , createSubnetMaskByte , flipBitsToOne } ;