pub fn decode_chain(input: &str) -> StringExpand description
Apply the full decode chain: percent → HTML → base64 → Unicode NFKC.
Each layer is best-effort:
- percent and HTML decoding pass non-matching bytes through unchanged
- base64 decoding requires the entire input to be a valid base64 token; otherwise the layer returns the input unchanged (no partial decode)
- NFKC always succeeds
§Examples
use agentsec_core::paste::obfuscation::decode_chain;
// Plain text passes through.
assert_eq!(decode_chain("hello"), "hello");
// Percent-encoded text is decoded.
assert_eq!(decode_chain("hello%20world"), "hello world");