jelle-s/bitmaskgenerator
Composer 安装命令:
composer require jelle-s/bitmaskgenerator
包简介
Generates all possible bitmasks with a minimum amount of positives (1's) and a certain length.
README 文档
README
Usage:
use Jelle_S\Util\BitMask\BitMaskGenerator; $length = 5; $minPositives = 2; // BitMaskGenerator that generates bitmasks with a length of 5 and at least two // positives (1's). $generator = new BitMaskGenerator($length, $minPositives); while ($mask = $generator->getNextMask()) { print $mask . "\n"; }
Output:
00011
00101
00110
01001
01010
01100
10001
10010
10100
11000
00111
01011
01101
01110
10011
10101
10110
11001
11010
11100
01111
10111
11011
11101
11110
11111
统计信息
- 总下载量: 229
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0
- 更新时间: 2016-12-13