/redactor

Redact Sensitive Information

Primary LanguageRustMIT LicenseMIT

Rust

Redactor

The String Redactor is a CLI tool written in Rust. It takes a string input and redacts the characters based on the options provided. You can configure the length to redact, the redaction character, characters to ignore, and specify if you want to ignore redaction on the first or last X number of characters.

Installation

Prerequisites

  • Rust and Cargo installed (Get it from here)

Steps

  1. Clone the repository:

    git clone https://github.com/ztroop/redactor.git
  2. Navigate to the project directory:

    cd redactor
  3. Install with cargo:

    cargo install --path .

Usage

Basic Syntax

redactor [FLAGS] [OPTIONS] <input_string>

Options

  • -r, --redact-char <char>: Character to use for redaction. The default is '*'.
  • -i, --ignore-char <char>: Character to ignore during redaction.
  • -e, --ignore-last <number>: Ignore the last X characters from redaction.
  • -f, --ignore-first <number>: Ignore the first X characters from redaction.

Examples

  • To redact the string "hello" completely:

    redactor hello
  • To redact the string "hello" but use # as the redaction character:

    redactor hello -r "#"
  • To redact the string "hello" but ignore l:

    redactor hello -i "l"
  • To redact the string "hello" but ignore the last 2 characters:

    redactor hello -e 2
  • To redact the string "hello" but ignore the first 2 characters:

    redactor hello -f 2