| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
LibP2P.Protocol.GossipSub.PartialMessages.Bitmap
Description
Little-endian-per-byte bitmap helpers compatible with go-libp2p-pubsub.
Synopsis
- data Bitmap
- emptyBitmap :: Int -> Bitmap
- fullBitmap :: Int -> Bitmap
- bitmapFromBytes :: ByteString -> Bitmap
- bitmapToBytes :: Bitmap -> ByteString
- bitmapSet :: Int -> Bitmap -> Bitmap
- bitmapClear :: Int -> Bitmap -> Bitmap
- bitmapMember :: Int -> Bitmap -> Bool
- bitmapUnion :: Bitmap -> Bitmap -> Bitmap
- bitmapIntersection :: Bitmap -> Bitmap -> Bitmap
- bitmapDifference :: Bitmap -> Bitmap -> Bitmap
- bitmapCount :: Bitmap -> Int
- bitmapIsZero :: Bitmap -> Bool
Documentation
emptyBitmap :: Int -> Bitmap Source #
A zeroed bitmap large enough for the requested bit count.
fullBitmap :: Int -> Bitmap Source #
A bitmap whose first bitCount bits are set.
bitmapFromBytes :: ByteString -> Bitmap Source #
bitmapToBytes :: Bitmap -> ByteString Source #
bitmapCount :: Bitmap -> Int Source #
bitmapIsZero :: Bitmap -> Bool Source #