encryption_macros/lib.rs
1//! # encryption-marcos
2//!
3//! This crate provides macros to XOR strings declarative or automatically at compile time and automatically decode them at run time.
4//!
5//! The XOR key is automatically generated via a macro expansion in the utils sub-crate.
6//! To generate a new key just run cargo clean and recompiled the target to re-expand this macro.
7//!
8//! ## Example
9//! ```rust
10//! use encryption_macros::encrypt_strings;
11//!
12//! encrypt_strings!{
13//! fn main() {
14//! println!("everything in this scope gets encrypted, {}", "even this")
15//! }
16//! }
17//! ```
18//!
19//! ## Warning
20//!
21//! `format_args!` cannot capture variables when the format string is expanded from a macro.
22//!
23//! So something like this: ```println!("{variable_a}")``` sadly doesn't work when inside an encrypted scope.
24
25
26pub use encryption_macros_encryption::*;
27pub use encryption_macros_utils::xor;
28
29/// # Re-export of [`hex::decode`] from [hex](https://github.com/KokaKiwi/rust-hex)
30pub use hex::decode;