Redacted
Library providing a transparent wrapper type for controlling [Debug
] and [Display
] behavior for
potentially sensitive collections of bytes, including completely redacting them.
This library is intended to aid in controlling how sensitive types, such as cryptographic types, appear in logs, including being able to redact them entirely to prevent leaking sensitive information through debug output. However, it is more generally useful, and can also be used simply to force byte arrays to render as hex or the like in debug output.
Examples
Completely redact contents
use FullyRedacted;
let item = new;
let output = format!;
assert_eq!;
Render contents as hex
use ;
let item: = new;
let output = format!;
assert_eq!;
Render contents as a truncated hex string
use ;
let item: = new;
let output = format!;
assert_eq!;