nexcore_codec/lib.rs
1//! Zero-dependency codec library for the NexCore ecosystem.
2//!
3//! # Supply Chain Sovereignty
4//!
5//! This crate replaces multiple external encoding/decoding crates:
6//!
7//! | Module | Replaces | Spec |
8//! |--------|----------|------|
9//! | [`hex`] | `hex` crate | RFC 4648 §8 (Base16) |
10//! | [`base64`] | `base64` crate | RFC 4648 §4/§5 (Base64) |
11//!
12//! # Examples
13//!
14//! ```
15//! // Hex encoding
16//! let encoded = nexcore_codec::hex::encode(b"NexVigilant");
17//! assert_eq!(encoded, "4e65785669676964616e74");
18//!
19//! // Base64 encoding
20//! let encoded = nexcore_codec::base64::encode(b"Hello");
21//! assert_eq!(encoded, "SGVsbG8=");
22//! ```
23
24#![forbid(unsafe_code)]
25#![warn(missing_docs)]
26#![cfg_attr(
27 not(test),
28 deny(clippy::unwrap_used, clippy::expect_used, clippy::panic)
29)]
30
31pub mod base64;
32pub mod hex;