9 releases (breaking)
| 0.7.0 | Nov 15, 2024 |
|---|---|
| 0.6.0 | Apr 29, 2024 |
| 0.5.0 | Feb 7, 2024 |
| 0.4.0 | Jun 20, 2023 |
| 0.0.1 | Sep 14, 2022 |
#19 in #parity
313,989 downloads per month
Used in 174 crates
(7 directly)
49KB
828 lines
scale-bits ·

This small utility crate provides two separate things:
- A
Bitstype that can be SCALE encoded and decoded, and is fully SCALE compatible with aBitVec<u8, Lsb0>. It's a deliberately simple type that is conceptually just a sequence of bools, and can be used as a replacement forBitVecwhen you don't need the additional complexity and functionality that it comes with. See thebitsmodule for more. - Utility methods to help encode and decode arbitrary bit sequences from their
SCALE representation, or skip over the corresponding bytes entirely, with zero
allocations. These bypass the need to first go via some
BitVecwith the right store/order type, and are WASM compatible (unlikeBitVec'su64store type). See thescalemodule for more.
These things play nicely together (ie you can encode and decode arbitrary bit
sequences directly into the Bits type), but don't need to be used together.
Dependencies
~4MB
~88K SLoC