Skip to main content

redact_text

Function redact_text 

Source
pub fn redact_text(text: &str, secrets: &[String]) -> String
Expand description

Replace every occurrence of a secret in text with the marker.

The rule is unconditional, including for one- and two-byte secrets: a short secret that survives inside a note would be stored in the canonical image and then hidden only by the projections, so the copy has to go at the source. It is the same implementation the canonicalizer uses, which is what makes a second pass a fixpoint (see crate::canonical).