1#![no_std]
2#![doc = include_str!("../README.md")]
3#![doc(
4 html_logo_url = "https://raw.githubusercontent.com/RustCrypto/media/6ee8e381/logo.svg",
5 html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/media/6ee8e381/logo.svg"
6)]
7#![cfg_attr(docsrs, feature(doc_cfg))]
8#![deny(unsafe_code)]
9
10#[cfg(feature = "alloc")]
11extern crate alloc;
12
13pub(crate) mod decode;
14#[cfg(feature = "alloc")]
15pub use decode::parse_into_vec;
16pub use decode::{Header, parse_into_array};
17
18#[cfg(feature = "alloc")]
19mod encode;
20#[cfg(feature = "alloc")]
21pub use encode::encode_blobs;
22
23#[derive(Debug, Eq, PartialEq, Copy, Clone)]
25pub enum Error {
26 InvalidVlq,
28 InvalidIndex,
30 UnexpectedEnd,
32 NotEnoughElements,
34 BadArrayLen,
36}
37
38const NEXT_MASK: u8 = 0b1000_0000;
39const VAL_MASK: u8 = 0b0111_1111;