BitCollections 1.0.1

A newer API for collections that store bits.

Install-Package BitCollections -Version 1.0.1
dotnet add package BitCollections --version 1.0.1
<PackageReference Include="BitCollections" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add BitCollections --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: BitCollections, 1.0.1"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install BitCollections as a Cake Addin
#addin nuget:?package=BitCollections&version=1.0.1

// Install BitCollections as a Cake Tool
#tool nuget:?package=BitCollections&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Licensed under the MIT License NuGet

BitCollections

BitCollections is a library that provides efficient collections storing bit values. It provides two types:

  • BitSet: An immutable struct, allocation-free when small bit indices are stored.

  • BitArrayNeo: A mutable class, has a similar API with System.Collections.BitArray, its modification methods return whether the collection changed.

These two types can be converted and checked for equality against each other. Both implement IEnumerable<int>, returning the indices of their active bits.

Missing features

BitArrayNeo is not a drop-in replacement for BitArray. In particular, it is missing features like:

  • The LeftShift/RightShift methods
  • Some additional constructors (such as accepting an array of bytes or booleans)
  • SIMD acceleration

BitSet is missing some set-relational operators (such as IsSubsetOf) that might come in handy. They will be added in a future release.

Licensed under the MIT License NuGet

BitCollections

BitCollections is a library that provides efficient collections storing bit values. It provides two types:

  • BitSet: An immutable struct, allocation-free when small bit indices are stored.

  • BitArrayNeo: A mutable class, has a similar API with System.Collections.BitArray, its modification methods return whether the collection changed.

These two types can be converted and checked for equality against each other. Both implement IEnumerable<int>, returning the indices of their active bits.

Missing features

BitArrayNeo is not a drop-in replacement for BitArray. In particular, it is missing features like:

  • The LeftShift/RightShift methods
  • Some additional constructors (such as accepting an array of bytes or booleans)
  • SIMD acceleration

BitSet is missing some set-relational operators (such as IsSubsetOf) that might come in handy. They will be added in a future release.

Release Notes

Fix an enumeration bug on bit collections whose smallest element is at least 128.
Use consistent casing in the bit collections' ToString representation.
Update framework dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on BitCollections:

Package Downloads
Farkle
Farkle is an LALR parser library with an API similar to parser combinators.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.1 383 1/26/2021
1.0.0 329 8/11/2020