this is a library for mask created apart from college work (ort singalovski)
this macro check if all bits in mask are off
this macro check if all bits in mask are on
this macro create number that only one bit is on
this functions inisialize mask from given size for exemple for size 5 the mask will be: 00011111
this functions turn on all the unused bits in mask for size 5 the mask will look like: 11100000
this function check if the bit by the index is on(1). for mask = 10000, usBitIndex = 3 will return FALSE
this function combine two masks using | operator. for 100010, 000001 result will be 100011
this function perform & on two mask and put the answer in result. for 100010, 000010 result will be 000010
this function turn on bit in a mask by a given index. for 10000, 1 mask will be 10001
this function turn off bit in a mask by a given index. for 10001, 1 mask will be 10000
this function will change the bit(0 to 1 or 1 to 0) in a bit by the index. for example: changeBit(10001, 1) 10000
this function count the amount of appearances of a given bit in a number. for example: countOnOff(1, 2, 1) 0000000[01] => 1
this function will copy the last nibble to the nibbles before him by the usTimes that we want and save the calculation in newNum
this function will convert a decimal number to hex number, but will keep the numbers value. for 1234 will return 0X1234
this function check if two given musks have the same bits by mask size for example: isBitsOn(767, 7, 2) 767 = 0000001011111111, 7 = 00000000000111 00000010111111[11] == 000000000001[11]
this function check if a given musk with his given size is inside a given mask. for example: 0000010111111110, -1 = 1111111111111111 00000101111[1111]0 == 111111111111[1111]
this function count the number of occurrences of a given musk with his given size is in a given mask. for example: 0000010111111110, 1111111111111111 0000010[1111][1111]0 == 11111111[1111][1111]
this function performing a cyclic left rotation n times for example: 10001 -> 00011
this function performing a cyclic right rotation n times for example: 10001 -> 00011
this function performing a right rotation n times and keeping the left bit for example: 1[10000] -> 1[11000]