Table of Contents

Class Redactor

Namespace
ZeroRedact
Assembly
ZeroRedact.dll

Implements redaction capabilities.

public sealed class Redactor : IRedactor
Inheritance
Redactor
Implements
Inherited Members

Constructors

Redactor()

Initializes a new instance of the Redactor class.

public Redactor()

Redactor(RedactorOptions)

Initializes a new instance of the Redactor class with the specified options.

public Redactor(RedactorOptions options)

Parameters

options RedactorOptions

The options to configure the redactor.

Exceptions

ArgumentOutOfRangeException

Thrown when options has a lass than 0 FixedLengthSize.

Methods

RedactCreditCard(ReadOnlySpan<char>)

Redacts the provided credit card number.

public ReadOnlySpan<char> RedactCreditCard(ReadOnlySpan<char> creditCardNumber)

Parameters

creditCardNumber ReadOnlySpan<char>

The credit card number to redact.

Returns

ReadOnlySpan<char>

RedactCreditCard(ReadOnlySpan<char>, CreditCardRedactorOptions)

Redacts the provided credit card number.

public ReadOnlySpan<char> RedactCreditCard(ReadOnlySpan<char> creditCardNumber, CreditCardRedactorOptions redactorOptions)

Parameters

creditCardNumber ReadOnlySpan<char>

The credit card number to redact.

redactorOptions CreditCardRedactorOptions

The options to control redaction behavior.

Returns

ReadOnlySpan<char>

RedactCreditCard(string)

Redacts the provided credit card number.

public string RedactCreditCard(string creditCardNumber)

Parameters

creditCardNumber string

The credit card number to redact.

Returns

string

RedactCreditCard(string, CreditCardRedactorOptions)

Redacts the provided credit card number.

public string RedactCreditCard(string creditCardNumber, CreditCardRedactorOptions redactorOptions)

Parameters

creditCardNumber string

The credit card number to redact.

redactorOptions CreditCardRedactorOptions

The options to control redaction behavior.

Returns

string

RedactDate(DateOnly)

Redacts the provided date.

public string RedactDate(DateOnly date)

Parameters

date DateOnly

The date to redact.

Returns

string

Returns redacted short date formatted for the current CultureInfo.

RedactDate(DateOnly, DateRedactorOptions)

Redacts the provided date.

public string RedactDate(DateOnly date, DateRedactorOptions redactorOptions)

Parameters

date DateOnly

The date to redact.

redactorOptions DateRedactorOptions

The options to control redaction behavior.

Returns

string

Returns redacted short date formatted for the current CultureInfo.

RedactDate(DateTime)

Redacts the provided date.

public string RedactDate(DateTime date)

Parameters

date DateTime

The date to redact.

Returns

string

Returns redacted short date formatted for the current CultureInfo.

RedactDate(DateTime, DateRedactorOptions)

Redacts the provided date.

public string RedactDate(DateTime date, DateRedactorOptions redactorOptions)

Parameters

date DateTime

The date to redact.

redactorOptions DateRedactorOptions

The options to control redaction behavior.

Returns

string

Returns redacted short date formatted for the current CultureInfo.

RedactEmailAddress(MailAddress)

Redacts the provided email address.

public string RedactEmailAddress(MailAddress emailAddress)

Parameters

emailAddress MailAddress

The email address to redact.

Returns

string

RedactEmailAddress(MailAddress, EmailAddressRedactorOptions)

Redacts the provided email address.

public string RedactEmailAddress(MailAddress emailAddress, EmailAddressRedactorOptions redactorOptions)

Parameters

emailAddress MailAddress

The email address to redact.

redactorOptions EmailAddressRedactorOptions

The options to control redaction behavior.

Returns

string

RedactEmailAddress(ReadOnlySpan<char>)

Redacts the provided email address.

public ReadOnlySpan<char> RedactEmailAddress(ReadOnlySpan<char> emailAddress)

Parameters

emailAddress ReadOnlySpan<char>

The email address to redact.

Returns

ReadOnlySpan<char>

RedactEmailAddress(ReadOnlySpan<char>, EmailAddressRedactorOptions)

Redacts the provided email address.

public ReadOnlySpan<char> RedactEmailAddress(ReadOnlySpan<char> emailAddress, EmailAddressRedactorOptions redactorOptions)

Parameters

emailAddress ReadOnlySpan<char>

The email address to redact.

redactorOptions EmailAddressRedactorOptions

The options to control redaction behavior.

Returns

ReadOnlySpan<char>

RedactEmailAddress(string)

Redacts the provided email address.

public string RedactEmailAddress(string emailAddress)

Parameters

emailAddress string

The email address to redact.

Returns

string

RedactEmailAddress(string, EmailAddressRedactorOptions)

Redacts the provided email address.

public string RedactEmailAddress(string emailAddress, EmailAddressRedactorOptions redactorOptions)

Parameters

emailAddress string

The email address to redact.

redactorOptions EmailAddressRedactorOptions

The options to control redaction behavior.

Returns

string

RedactIPv4Address(ReadOnlySpan<char>)

Redacts the provided IPv4 address.

public ReadOnlySpan<char> RedactIPv4Address(ReadOnlySpan<char> ipAddress)

Parameters

ipAddress ReadOnlySpan<char>

The IPv4 address to redact.

Returns

ReadOnlySpan<char>

RedactIPv4Address(ReadOnlySpan<char>, IPv4AddressRedactorOptions)

Redacts the provided IPv4 address.

public ReadOnlySpan<char> RedactIPv4Address(ReadOnlySpan<char> ipAddress, IPv4AddressRedactorOptions redactorOptions)

Parameters

ipAddress ReadOnlySpan<char>

The IPv4 address to redact.

redactorOptions IPv4AddressRedactorOptions

The options to control redaction behavior.

Returns

ReadOnlySpan<char>

RedactIPv4Address(string)

Redacts the provided IPv4 address.

public string RedactIPv4Address(string ipAddress)

Parameters

ipAddress string

The IPv4 address to redact.

Returns

string

RedactIPv4Address(string, IPv4AddressRedactorOptions)

Redacts the provided IPv4 address.

public string RedactIPv4Address(string ipAddress, IPv4AddressRedactorOptions redactorOptions)

Parameters

ipAddress string

The IPv4 address to redact.

redactorOptions IPv4AddressRedactorOptions

The options to control redaction behavior.

Returns

string

RedactIPv6Address(ReadOnlySpan<char>)

Redacts the provided IPv6 address.

public ReadOnlySpan<char> RedactIPv6Address(ReadOnlySpan<char> ipAddress)

Parameters

ipAddress ReadOnlySpan<char>

The IPv6 address to redact

Returns

ReadOnlySpan<char>

RedactIPv6Address(ReadOnlySpan<char>, IPv6AddressRedactorOptions)

Redacts the provided IPv6 address.

public ReadOnlySpan<char> RedactIPv6Address(ReadOnlySpan<char> ipAddress, IPv6AddressRedactorOptions redactorOptions)

Parameters

ipAddress ReadOnlySpan<char>

The IPv6 address to redact.

redactorOptions IPv6AddressRedactorOptions

The options to control redaction behavior.

Returns

ReadOnlySpan<char>

RedactIPv6Address(string)

Redacts the provided IPv6 address.

public string RedactIPv6Address(string ipAddress)

Parameters

ipAddress string

The IPv6 address to redact

Returns

string

RedactIPv6Address(string, IPv6AddressRedactorOptions)

Redacts the provided IPv6 address.

public string RedactIPv6Address(string ipAddress, IPv6AddressRedactorOptions redactorOptions)

Parameters

ipAddress string

The IPv6 address to redact.

redactorOptions IPv6AddressRedactorOptions

The options to control redaction behavior.

Returns

string

RedactMACAddress(ReadOnlySpan<char>)

Redacts the provided MAC address.

public ReadOnlySpan<char> RedactMACAddress(ReadOnlySpan<char> macAddress)

Parameters

macAddress ReadOnlySpan<char>

The MAC address to redact.

Returns

ReadOnlySpan<char>

RedactMACAddress(ReadOnlySpan<char>, MACAddressRedactorOptions)

Redacts the provided MAC address.

public ReadOnlySpan<char> RedactMACAddress(ReadOnlySpan<char> macAddress, MACAddressRedactorOptions redactorOptions)

Parameters

macAddress ReadOnlySpan<char>

The MAC address to redact.

redactorOptions MACAddressRedactorOptions

The options to control redaction behavior.

Returns

ReadOnlySpan<char>

RedactMACAddress(string)

Redacts the provided MAC address.

public string RedactMACAddress(string macAddress)

Parameters

macAddress string

The MAC address to redact.

Returns

string

RedactMACAddress(string, MACAddressRedactorOptions)

Redacts the provided MAC address.

public string RedactMACAddress(string macAddress, MACAddressRedactorOptions redactorOptions)

Parameters

macAddress string

The MAC address to redact.

redactorOptions MACAddressRedactorOptions

The options to control redaction behavior.

Returns

string

RedactPhoneNumber(ReadOnlySpan<char>)

Redacts the provided phone number.

public ReadOnlySpan<char> RedactPhoneNumber(ReadOnlySpan<char> phoneNumber)

Parameters

phoneNumber ReadOnlySpan<char>

The phone number to redact.

Returns

ReadOnlySpan<char>

RedactPhoneNumber(ReadOnlySpan<char>, PhoneNumberRedactorOptions)

Redacts the provided phone number.

public ReadOnlySpan<char> RedactPhoneNumber(ReadOnlySpan<char> phoneNumber, PhoneNumberRedactorOptions redactorOptions)

Parameters

phoneNumber ReadOnlySpan<char>

The phone number to redact.

redactorOptions PhoneNumberRedactorOptions

The options to control redaction behavior.

Returns

ReadOnlySpan<char>

RedactPhoneNumber(string)

Redacts the provided phone number.

public string RedactPhoneNumber(string phoneNumber)

Parameters

phoneNumber string

The phone number to redact.

Returns

string

RedactPhoneNumber(string, PhoneNumberRedactorOptions)

Redacts the provided phone number.

public string RedactPhoneNumber(string phoneNumber, PhoneNumberRedactorOptions redactorOptions)

Parameters

phoneNumber string

The phone number to redact.

redactorOptions PhoneNumberRedactorOptions

The options to control redaction behavior.

Returns

string

RedactString(ReadOnlySpan<char>)

Redacts the provided string.

public ReadOnlySpan<char> RedactString(ReadOnlySpan<char> value)

Parameters

value ReadOnlySpan<char>

The string to redact.

Returns

ReadOnlySpan<char>

RedactString(ReadOnlySpan<char>, StringRedactorOptions)

Redacts the provided string.

public ReadOnlySpan<char> RedactString(ReadOnlySpan<char> value, StringRedactorOptions redactorOptions)

Parameters

value ReadOnlySpan<char>

The string to redact.

redactorOptions StringRedactorOptions

The redactorOptions to control redaction behavior.

Returns

ReadOnlySpan<char>

RedactString(string)

Redacts the provided string.

public string RedactString(string value)

Parameters

value string

The string to redact.

Returns

string

RedactString(string, StringRedactorOptions)

Redacts the provided string.

public string RedactString(string value, StringRedactorOptions redactorOptions)

Parameters

value string

The string to redact.

redactorOptions StringRedactorOptions

The redactorOptions to control redaction behavior.

Returns

string