Macro obfuscate

Source
macro_rules! obfuscate {
    ($($tokens:tt)*) => { ... };
}
Expand description

Obfuscate a string literal.

Supports normal strings, byte strings and C strings.

It gives you a reference to a temporary that holds the de-obfucated string. The memory holding the de-obfuscated data will be overwritten with zeroes when the value is dropped.

ยงUsage

println!("{}", obfuscate!("Hello world!"));
std::io::stdout().write_all(obfuscate!(b"Hello world!"))?;
std::io::stdout().write_all(obfuscate!(c"Hello world!").to_bytes())?;