Acme-Bitfield

 view release on metacpan or  search on metacpan

README.md  view on Meta::CPAN


`Acme::Bitfield` provides a compact way to track a large set of big endian boolean flags. It is specifically designed
to follow the BitTorrent (BEP 03) bit-ordering convention, where the most significant bit of the first byte represents
index 0.

## Bit Ordering

\* Byte 0, Bit 0 (0x80) -> Index 0 \* Byte 0, Bit 7 (0x01) -> Index 7 \* Byte 1, Bit 0 (0x80) -> Index 8

This is the inverse of Perl's internal `vec` bit-ordering, and this module handles the necessary bit-swizzling
transparently.

# METHODS

## `get( $index )`

Returns 1 if the bit at `$index` is set, 0 otherwise.

## `set( $index )`

Sets the bit at `$index` to 1.

lib/Acme/Bitfield.pod  view on Meta::CPAN


C<Acme::Bitfield> provides a compact way to track a large set of big endian boolean flags. It is specifically designed
to follow the BitTorrent (BEP 03) bit-ordering convention, where the most significant bit of the first byte represents
index 0.

=head2 Bit Ordering

* Byte 0, Bit 0 (0x80) -> Index 0 * Byte 0, Bit 7 (0x01) -> Index 7 * Byte 1, Bit 0 (0x80) -> Index 8

This is the inverse of Perl's internal C<vec> bit-ordering, and this module handles the necessary bit-swizzling
transparently.

=head1 METHODS

=head2 C<get( $index )>

Returns 1 if the bit at C<$index> is set, 0 otherwise.

=head2 C<set( $index )>

Sets the bit at C<$index> to 1.



( run in 2.312 seconds using v1.01-cache-2.11-cpan-2398b32b56e )