bit_array 1.0.1

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • new66

Bit array implementation in Dart

A bit array (also known as BitMap, BitSet, BitString, or BitVector) is an array data structure that compactly stores bits.

Usage

A simple usage example:

import 'package:bit_array/bit_array.dart';

main() {
  final array = new FixedBitArray(1024);
  array[12] = true;
  array.setBit(123);
  array.invertBit(200);
  array.clearBit(12);
  print(array.asIntIterable().toList()); // prints [123, 200]

  final other = new FixedBitArray(1024);
  other[123] = true;

  final and = array & other;
  print(and.asIntIterable().toList()); // prints [123]
}

1.0.1

  • asUint64Iterable() added to provide interface-level compatibility for future compressed bit arrays.
  • BitSet to have a non-bitarray backed interface (eg. compressed structures).
  • CompositeSet and CompositeCounter for arbitrary-large compressed bitmap operations.

1.0.0

  • Initial version.

example/example.dart

import 'package:bit_array/bit_array.dart';

main() {
  final array = new BitArray(1024);
  array[12] = true;
  array.setBit(123);
  array.invertBit(200);
  array.clearBit(12);
  print(array.asIntIterable().toList()); // prints [123, 200]

  final other = new BitArray(1024);
  other[123] = true;

  final and = array & other;
  print(and.asIntIterable().toList()); // prints [123]
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  bit_array: ^1.0.1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:bit_array/bit_array.dart';
  
Version Uploaded Documentation Archive
1.0.1 Nov 9, 2018 Go to the documentation of bit_array 1.0.1 Download bit_array 1.0.1 archive
1.0.0 Nov 4, 2018 Go to the documentation of bit_array 1.0.0 Download bit_array 1.0.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
33
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
66
Learn more about scoring.

We analyzed this package on Nov 14, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0
  • pana: 0.12.6

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:bit_array/bit_array.dart.

Health suggestions

Format lib/src/composite_set.dart.

Run dartfmt to format lib/src/composite_set.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
Dev dependencies
test ^1.0.0