1 | <?php |
||
7 | class BitMask |
||
8 | { |
||
9 | const MASK_LO = 0; |
||
10 | const MASK_HI = 1; |
||
11 | |||
12 | /** |
||
13 | * @var array |
||
14 | */ |
||
15 | private $bitMasks = [ |
||
16 | [0x00, 0xFF], |
||
17 | [0x01, 0x7F], |
||
18 | [0x03, 0x3F], |
||
19 | [0x07, 0x1F], |
||
20 | [0x0F, 0x0F], |
||
21 | [0x1F, 0x07], |
||
22 | [0x3F, 0x03], |
||
23 | [0x7F, 0x01], |
||
24 | [0xFF, 0x00] |
||
25 | ]; |
||
26 | |||
27 | /** |
||
28 | * @return array |
||
29 | */ |
||
30 | 69 | public function getBitMasks() |
|
34 | |||
35 | /** |
||
36 | * @param int $bit |
||
37 | * @param int $type |
||
38 | * @return mixed |
||
39 | * @throws Exception\InvalidDataException |
||
40 | */ |
||
41 | 69 | public function getMask($bit, $type) |
|
53 | } |
||
54 |