Crates.io | scale-bits |
lib.rs | scale-bits |
version | 0.6.0 |
source | src |
created_at | 2022-09-14 12:32:04.615689 |
updated_at | 2024-04-29 09:52:46.34903 |
description | A SCALE compatible representation of a collection of bits |
homepage | https://www.parity.io/ |
repository | https://github.com/paritytech/scale-bits |
max_upload_size | |
id | 665745 |
size | 59,522 |
This small utility crate provides two separate things:
Bits
type that can be SCALE encoded and decoded, and is fully
SCALE compatible with a BitVec<u8, Lsb0>
. It's a deliberately simple
type that is conceptually just a sequence of bools, and can be used as
a replacement for BitVec
when you don't need the additional complexity
and functionality that it comes with. See the bits
module for more.BitVec
with the
right store/order type, and are WASM compatible (unlike BitVec
's u64
store
type). See the scale
module 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.