Radar · Rust · Archive · Week 20 · May 11 – 17, 2026
cloakrs – Crate of the week
Worth knowingecosystem
- What changed
- This Week in Rust 651 announced cloakrs, a library and CLI tool for detecting and masking personally identifiable information.
- Production impact
- The source does not say.
- Try it
- The source does not say.
- Source
- this-week-in-rust.org/blog/2026/05/13/this-week-in-rust-651/
Understand it, then run it
Run it now
// This program demonstrates a simple PII masking routine.
// The real `cloakrs` crate is not available in this sandbox,
// so we implement a minimal example that masks email addresses
// by replacing the local part with asterisks.
fn mask_email(email: &str) -> String {
// Split at the first '@' character.
if let Some(pos) = email.find('@') {
let (local, domain) = email.split_at(pos);
// Replace the local part with asterisks of the same length.
let masked_local = "*".repeat(local.len());
format!("{}{}", masked_local, domain)
} else {
// Not an email, return unchanged.
email.to_string()
}
}
fn main() {
let examples = [
"[email protected]",
"[email protected]",
"no-at-symbol",
];
for e in &examples {
println!("{} -> {}", e, mask_email(e));
}
}
What it printed when we ran it on Rust 1.98.1 (edition 2024)
[email protected] -> *****@example.com [email protected] -> *********@rust-lang.org no-at-symbol -> no-at-symbol
Run sends this program (for Solidity, the contract and its tests) to our own sandbox, where it is compiled and run once, with no network, and what it printed or the test report comes back here. Nothing is kept. Runs are counted per visitor for the day so everyone gets a turn; the details are on the legal page.
Written by gpt-oss-20b from the linked source · claims checked against the sources · archive, not individually reviewed