bitcount 0.1.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 64

bitcount #

Description #

More or less fast bit count (also known as popcount) extension for default int.

How to use #

See example directory.

License #

MIT

Changelog #

[0.1.2] - 2020-02-21 #

Fixed #

  • switched visibility for implementation detail so it is no longer exposed as public.

[0.1.1] - 2020-02-21 #

Changed #

  • moved example from README to example directory.
  • updated description to have more details.

Fixed #

  • bump minimum required sdk version. Extension methods were added in 2.6.0.

[0.1.0] - 2020-02-21 #

Added #

  • initial implementation with tests and benchmark

example/example.dart

import 'package:bitcount/bitcount.dart';

void main() {
  print('one bits in 32: ${32.bitCount()}'); // 1
  print('one bits in 31: ${(32 - 1).bitCount()}'); // 5
}

Use this package as a library

1. Depend on it

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


dependencies:
  bitcount: ^0.1.2

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

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

3. Import it

Now in your Dart code, you can use:


import 'package:bitcount/bitcount.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
28
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]
64
Learn more about scoring.

We analyzed this package on Mar 30, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.6

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.6.0 <3.0.0
Dev dependencies
benchmark_harness ^1.0.0
pedantic ^1.9.0
test ^1.0.0