pub fn leetspeak(input: &str) -> StringExpand description
Converts text to leetspeak by replacing letters with similar-looking numbers/symbols.
Transforms letters into visually similar numbers and symbols using common leetspeak (1337speak) substitutions: a→4/@, e→3, i→1/!, o→0, s→5/$, t→7, l→1, g→9, b→8. Some characters have random variations to create more natural leetspeak patterns.
§Use Cases
- Red Team: Bypass keyword filters that only match literal strings
- Blue Team: Test password strength checkers and profanity filters
- Social Engineering: Create obfuscated usernames or messages
- Content Detection: Test how systems handle character substitution
§Examples
use redstr::leetspeak;
let result = leetspeak("password");
// Example output: "p@55w0rd" or "p4$$w0rd" (varies slightly)
assert!(result.contains('0') || result.contains('5'));
// Bypass simple content filters
let blocked = leetspeak("blocked word");
// Output: "81ock3d w0rd"
// Obfuscate commands
let cmd = leetspeak("select");
// Output: "53l3c7" or "$e1ec7"