ant-hill/bitmap

dev-master 2017-08-30 18:12 UTC

This package is not auto-updated.

Last update: 2024-09-21 15:00:15 UTC


README

简单的库,允许通过偏移量添加、删除、检查位。偏移量可以是0到PHP_INT_MAX之间的范围。

简单用法

    $bitMapOffset = new BitMapOffset(4,/* Chunk size, max size for correct work is (PHP_INT_SIZE*8)-1 */);
    $bitMapArray =  new BitMapArray($bitMapOffset,[] /* BitMap Array */);

    $bitMapArray->add(3); // Add set 3rd bit at 1
    $bitMapArray->has(3); // Check for 3rd bit is set
    $bitMapArray->del(3); // Delete 3rd bit if exists