1#![cfg_attr(feature = "base64url", doc = include_str!("../README.md"))]
16#![forbid(unsafe_code)]
17
18#[cfg(feature = "base64")]
20pub mod base64 {
21 pub use codec_base64::{base64_to_bytes, bytes_to_base64, Base64Error};
22}
23
24#[cfg(feature = "base64url")]
26pub mod base64url {
27 pub use codec_base64url::{
28 base64url_bytes_to_bytes, base64url_to_bytes, bytes_to_base64url, Base64UrlError,
29 };
30
31 #[cfg(feature = "serde")]
32 pub use codec_base64url::{serde_bytes, serde_option_bytes};
33}
34
35#[cfg(feature = "cbor")]
37pub mod cbor {
38 pub use codec_cbor::{
39 compute_cid_dag_cbor, dag_cbor_multihash, decode_dag_cbor, decode_deterministic_cbor,
40 encode_dag_cbor, encode_deterministic_cbor, is_valid_cid_string, sha2_256_content_hash,
41 try_parse_cid, verify_dag_cbor_cid, CborError, CborValue, CidVerificationStatus,
42 ContentHash, DagCborCidVerification, DagCborMultihash, DeterministicCborError,
43 DeterministicCborInteger, DeterministicCborMapEntry, DeterministicCborMapKey,
44 DeterministicCborNegativeInteger, DeterministicCborProfileError, DeterministicCborValue,
45 ParsedCid, DAG_CBOR_CODEC, DETERMINISTIC_CBOR_NEGATIVE_MAX,
46 DETERMINISTIC_CBOR_NEGATIVE_MIN, MAX_DETERMINISTIC_CBOR_AGGREGATE_BYTE_STRING_BYTES,
47 MAX_DETERMINISTIC_CBOR_AGGREGATE_TEXT_BYTES, MAX_DETERMINISTIC_CBOR_CONTAINER_ENTRIES,
48 MAX_DETERMINISTIC_CBOR_INPUT_LEN, MAX_DETERMINISTIC_CBOR_NESTING_DEPTH,
49 MAX_DETERMINISTIC_CBOR_NODES, MAX_DETERMINISTIC_CBOR_OUTPUT_LEN,
50 };
51}
52
53#[cfg(feature = "hex")]
55pub mod hex {
56 pub use codec_hex::{bytes_to_lower_hex, lower_hex_to_bytes, write_lower_hex, HexError};
57}
58
59#[cfg(feature = "jcs")]
61pub mod jcs {
62 pub use codec_jcs::{canonicalize_json_text, canonicalize_trusted_json_value, JcsError};
63}
64
65#[cfg(feature = "multibase")]
67pub mod multibase {
68 pub use codec_multibase::{
69 base58btc_decode, base58btc_encode, bytes_to_multibase58btc, bytes_to_multibase_base64url,
70 multibase_to_bytes, Base58Error, MultibaseError,
71 };
72}
73
74#[cfg(feature = "multicodec")]
76pub mod multicodec;
77
78#[cfg(feature = "multikey")]
80pub mod multikey {
81 #[allow(deprecated)]
82 pub use codec_multikey::{
83 binding_type_matches_codec, encode_multikey, parse_multikey, validate_key_binding,
84 validate_multikey_binding, KeyBindingInput, MultikeyError, ParsedMultikey,
85 };
86}
87
88#[cfg(feature = "pem")]
90pub mod pem {
91 pub use codec_pem::{
92 decode_pem, encode_pem, PemDecodePolicy, PemDocument, PemEncodeOptions, PemError, PemLabel,
93 PemLineEnding,
94 };
95}
96
97#[cfg(feature = "operation-contract")]
99pub mod operation_contract;