| 1 | <?php |
||
| 5 | class MultiHash |
||
| 6 | { |
||
| 7 | |||
| 8 | protected $hashOne; |
||
| 9 | |||
| 10 | protected $hashTwo; |
||
| 11 | |||
| 12 | protected $upperBound; |
||
| 13 | |||
| 14 | protected $hashCount; |
||
| 15 | |||
| 16 | public function __construct(Hash $hashOne = null, Hash $hashTwo = null) |
||
| 32 | |||
| 33 | public function setUpperBound($upperBound) |
||
| 37 | |||
| 38 | public function setHashCount($hashCount) |
||
| 42 | |||
| 43 | /** |
||
| 44 | * hash(i) = (a + b * i ) % m |
||
| 45 | * |
||
| 46 | * @param $string |
||
| 47 | * @return array |
||
| 48 | */ |
||
| 49 | public function hash($string) |
||
| 62 | |||
| 63 | } |
||
| 64 |