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::general;
39 pub use codec_cbor::{
40 compute_cid_dag_cbor, dag_cbor_multihash, decode_dag_cbor, decode_deterministic_cbor,
41 encode_dag_cbor, encode_deterministic_cbor, is_valid_cid_string, sha2_256_content_hash,
42 try_parse_cid, verify_dag_cbor_cid, CborError, CborValue, CidVerificationStatus,
43 ContentHash, DagCborCidVerification, DagCborMultihash, DeterministicCborError,
44 DeterministicCborInteger, DeterministicCborMapEntry, DeterministicCborMapKey,
45 DeterministicCborNegativeInteger, DeterministicCborProfileError, DeterministicCborValue,
46 ParsedCid, DAG_CBOR_CODEC, DETERMINISTIC_CBOR_NEGATIVE_MAX,
47 DETERMINISTIC_CBOR_NEGATIVE_MIN, MAX_DETERMINISTIC_CBOR_AGGREGATE_BYTE_STRING_BYTES,
48 MAX_DETERMINISTIC_CBOR_AGGREGATE_TEXT_BYTES, MAX_DETERMINISTIC_CBOR_CONTAINER_ENTRIES,
49 MAX_DETERMINISTIC_CBOR_INPUT_LEN, MAX_DETERMINISTIC_CBOR_NESTING_DEPTH,
50 MAX_DETERMINISTIC_CBOR_NODES, MAX_DETERMINISTIC_CBOR_OUTPUT_LEN,
51 };
52}
53
54#[cfg(feature = "der")]
56pub mod der;
57
58#[cfg(feature = "hex")]
60pub mod hex {
61 pub use codec_hex::{bytes_to_lower_hex, lower_hex_to_bytes, write_lower_hex, HexError};
62}
63
64#[cfg(feature = "jcs")]
66pub mod jcs {
67 pub use codec_jcs::{canonicalize_json_text, canonicalize_trusted_json_value, JcsError};
68}
69
70#[cfg(feature = "multibase")]
72pub mod multibase {
73 pub use codec_multibase::{
74 base58btc_decode, base58btc_encode, bytes_to_multibase58btc, bytes_to_multibase_base64url,
75 multibase_to_bytes, Base58Error, MultibaseError,
76 };
77}
78
79#[cfg(feature = "multicodec")]
81pub mod multicodec;
82
83#[cfg(feature = "multikey")]
85pub mod multikey {
86 #[allow(deprecated)]
87 pub use codec_multikey::{
88 binding_type_matches_codec, encode_multikey, parse_multikey, validate_key_binding,
89 validate_multikey_binding, KeyBindingInput, MultikeyError, ParsedMultikey,
90 };
91}
92
93#[cfg(feature = "pem")]
95pub mod pem {
96 pub use codec_pem::{
97 decode_pem, encode_pem, PemDecodePolicy, PemDocument, PemEncodeOptions, PemError, PemLabel,
98 PemLineEnding,
99 };
100}
101
102#[cfg(feature = "operation-contract")]
104pub mod operation_contract;