Skip to main content

Module encoding

Module encoding 

Source

Re-exportsยง

pub use cid_de_cbor::extract_cids;

Modulesยง

cid_de_cbor ๐Ÿ”’
fallback_de_ipld_dagcbor ๐Ÿ”’
serde_byte_array
serde_bytes with max length check

Functionsยง

blake2b_256
Generates BLAKE2b hash of fixed 32 bytes size.
from_slice_with_fallback
This method will attempt to de-serialize given bytes using the regular serde_ipld_dagcbor::from_slice. Due to a historical issue in Lotus (see more in FIP-0027, we must still support strings with invalid UTF-8 bytes. On a failure, it will retry the operation using the fallback that will de-serialize strings with invalid UTF-8 bytes as bytes.
keccak_256
Generates Keccak-256 hash of fixed 32 bytes size.
prover_id_from_u64
size_hint_cautious_cid ๐Ÿ”’
Limit the the number of bytes that are used for pre-allocating Vec<Cid>s. This follows what serde is doing internally with serde::private::size_hint::cautious(). The limit is set to 1 MiB, which is a reasonable upper bound for most use cases.