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
- optionsRedactorOptions
- The options to configure the redactor. 
Exceptions
- ArgumentOutOfRangeException
- Thrown when - optionshas a less than one FixedLengthSize.
Methods
RedactCreditCard(ReadOnlySpan<char>)
Redacts the provided credit card number.
public ReadOnlySpan<char> RedactCreditCard(ReadOnlySpan<char> creditCardNumber)Parameters
- creditCardNumberReadOnlySpan<char>
- The credit card number to redact. 
Returns
RedactCreditCard(ReadOnlySpan<char>, CreditCardRedactorOptions)
Redacts the provided credit card number.
public ReadOnlySpan<char> RedactCreditCard(ReadOnlySpan<char> creditCardNumber, CreditCardRedactorOptions redactorOptions)Parameters
- creditCardNumberReadOnlySpan<char>
- The credit card number to redact. 
- redactorOptionsCreditCardRedactorOptions
- The options to control redaction behavior. 
Returns
RedactCreditCard(string)
Redacts the provided credit card number.
public string RedactCreditCard(string creditCardNumber)Parameters
- creditCardNumberstring
- The credit card number to redact. 
Returns
RedactCreditCard(string, CreditCardRedactorOptions)
Redacts the provided credit card number.
public string RedactCreditCard(string creditCardNumber, CreditCardRedactorOptions redactorOptions)Parameters
- creditCardNumberstring
- The credit card number to redact. 
- redactorOptionsCreditCardRedactorOptions
- The options to control redaction behavior. 
Returns
RedactDate(DateOnly)
Redacts the provided date.
public string RedactDate(DateOnly date)Parameters
- dateDateOnly
- 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
- dateDateOnly
- The date to redact. 
- redactorOptionsDateRedactorOptions
- 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
- dateDateTime
- 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
- dateDateTime
- The date to redact. 
- redactorOptionsDateRedactorOptions
- 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
- emailAddressMailAddress
- The email address to redact. 
Returns
RedactEmailAddress(MailAddress, EmailAddressRedactorOptions)
Redacts the provided email address.
public string RedactEmailAddress(MailAddress emailAddress, EmailAddressRedactorOptions redactorOptions)Parameters
- emailAddressMailAddress
- The email address to redact. 
- redactorOptionsEmailAddressRedactorOptions
- The options to control redaction behavior. 
Returns
RedactEmailAddress(ReadOnlySpan<char>)
Redacts the provided email address.
public ReadOnlySpan<char> RedactEmailAddress(ReadOnlySpan<char> emailAddress)Parameters
- emailAddressReadOnlySpan<char>
- The email address to redact. 
Returns
RedactEmailAddress(ReadOnlySpan<char>, EmailAddressRedactorOptions)
Redacts the provided email address.
public ReadOnlySpan<char> RedactEmailAddress(ReadOnlySpan<char> emailAddress, EmailAddressRedactorOptions redactorOptions)Parameters
- emailAddressReadOnlySpan<char>
- The email address to redact. 
- redactorOptionsEmailAddressRedactorOptions
- The options to control redaction behavior. 
Returns
RedactEmailAddress(string)
Redacts the provided email address.
public string RedactEmailAddress(string emailAddress)Parameters
- emailAddressstring
- The email address to redact. 
Returns
RedactEmailAddress(string, EmailAddressRedactorOptions)
Redacts the provided email address.
public string RedactEmailAddress(string emailAddress, EmailAddressRedactorOptions redactorOptions)Parameters
- emailAddressstring
- The email address to redact. 
- redactorOptionsEmailAddressRedactorOptions
- The options to control redaction behavior. 
Returns
RedactIPv4Address(ReadOnlySpan<char>)
Redacts the provided IPv4 address.
public ReadOnlySpan<char> RedactIPv4Address(ReadOnlySpan<char> ipAddress)Parameters
- ipAddressReadOnlySpan<char>
- The IPv4 address to redact. 
Returns
RedactIPv4Address(ReadOnlySpan<char>, IPv4AddressRedactorOptions)
Redacts the provided IPv4 address.
public ReadOnlySpan<char> RedactIPv4Address(ReadOnlySpan<char> ipAddress, IPv4AddressRedactorOptions redactorOptions)Parameters
- ipAddressReadOnlySpan<char>
- The IPv4 address to redact. 
- redactorOptionsIPv4AddressRedactorOptions
- The options to control redaction behavior. 
Returns
RedactIPv4Address(string)
Redacts the provided IPv4 address.
public string RedactIPv4Address(string ipAddress)Parameters
- ipAddressstring
- The IPv4 address to redact. 
Returns
RedactIPv4Address(string, IPv4AddressRedactorOptions)
Redacts the provided IPv4 address.
public string RedactIPv4Address(string ipAddress, IPv4AddressRedactorOptions redactorOptions)Parameters
- ipAddressstring
- The IPv4 address to redact. 
- redactorOptionsIPv4AddressRedactorOptions
- The options to control redaction behavior. 
Returns
RedactIPv6Address(ReadOnlySpan<char>)
Redacts the provided IPv6 address.
public ReadOnlySpan<char> RedactIPv6Address(ReadOnlySpan<char> ipAddress)Parameters
- ipAddressReadOnlySpan<char>
- The IPv6 address to redact 
Returns
RedactIPv6Address(ReadOnlySpan<char>, IPv6AddressRedactorOptions)
Redacts the provided IPv6 address.
public ReadOnlySpan<char> RedactIPv6Address(ReadOnlySpan<char> ipAddress, IPv6AddressRedactorOptions redactorOptions)Parameters
- ipAddressReadOnlySpan<char>
- The IPv6 address to redact. 
- redactorOptionsIPv6AddressRedactorOptions
- The options to control redaction behavior. 
Returns
RedactIPv6Address(string)
Redacts the provided IPv6 address.
public string RedactIPv6Address(string ipAddress)Parameters
- ipAddressstring
- The IPv6 address to redact 
Returns
RedactIPv6Address(string, IPv6AddressRedactorOptions)
Redacts the provided IPv6 address.
public string RedactIPv6Address(string ipAddress, IPv6AddressRedactorOptions redactorOptions)Parameters
- ipAddressstring
- The IPv6 address to redact. 
- redactorOptionsIPv6AddressRedactorOptions
- The options to control redaction behavior. 
Returns
RedactMACAddress(ReadOnlySpan<char>)
Redacts the provided MAC address.
public ReadOnlySpan<char> RedactMACAddress(ReadOnlySpan<char> macAddress)Parameters
- macAddressReadOnlySpan<char>
- The MAC address to redact. 
Returns
RedactMACAddress(ReadOnlySpan<char>, MACAddressRedactorOptions)
Redacts the provided MAC address.
public ReadOnlySpan<char> RedactMACAddress(ReadOnlySpan<char> macAddress, MACAddressRedactorOptions redactorOptions)Parameters
- macAddressReadOnlySpan<char>
- The MAC address to redact. 
- redactorOptionsMACAddressRedactorOptions
- The options to control redaction behavior. 
Returns
RedactMACAddress(string)
Redacts the provided MAC address.
public string RedactMACAddress(string macAddress)Parameters
- macAddressstring
- The MAC address to redact. 
Returns
RedactMACAddress(string, MACAddressRedactorOptions)
Redacts the provided MAC address.
public string RedactMACAddress(string macAddress, MACAddressRedactorOptions redactorOptions)Parameters
- macAddressstring
- The MAC address to redact. 
- redactorOptionsMACAddressRedactorOptions
- The options to control redaction behavior. 
Returns
RedactPhoneNumber(ReadOnlySpan<char>)
Redacts the provided phone number.
public ReadOnlySpan<char> RedactPhoneNumber(ReadOnlySpan<char> phoneNumber)Parameters
- phoneNumberReadOnlySpan<char>
- The phone number to redact. 
Returns
RedactPhoneNumber(ReadOnlySpan<char>, PhoneNumberRedactorOptions)
Redacts the provided phone number.
public ReadOnlySpan<char> RedactPhoneNumber(ReadOnlySpan<char> phoneNumber, PhoneNumberRedactorOptions redactorOptions)Parameters
- phoneNumberReadOnlySpan<char>
- The phone number to redact. 
- redactorOptionsPhoneNumberRedactorOptions
- The options to control redaction behavior. 
Returns
RedactPhoneNumber(string)
Redacts the provided phone number.
public string RedactPhoneNumber(string phoneNumber)Parameters
- phoneNumberstring
- The phone number to redact. 
Returns
RedactPhoneNumber(string, PhoneNumberRedactorOptions)
Redacts the provided phone number.
public string RedactPhoneNumber(string phoneNumber, PhoneNumberRedactorOptions redactorOptions)Parameters
- phoneNumberstring
- The phone number to redact. 
- redactorOptionsPhoneNumberRedactorOptions
- The options to control redaction behavior. 
Returns
RedactString(ReadOnlySpan<char>)
Redacts the provided string.
public ReadOnlySpan<char> RedactString(ReadOnlySpan<char> value)Parameters
- valueReadOnlySpan<char>
- The string to redact. 
Returns
RedactString(ReadOnlySpan<char>, StringRedactorOptions)
Redacts the provided string.
public ReadOnlySpan<char> RedactString(ReadOnlySpan<char> value, StringRedactorOptions redactorOptions)Parameters
- valueReadOnlySpan<char>
- The string to redact. 
- redactorOptionsStringRedactorOptions
- The redactorOptions to control redaction behavior. 
Returns
RedactString(string)
Redacts the provided string.
public string RedactString(string value)Parameters
- valuestring
- The string to redact. 
Returns
RedactString(string, StringRedactorOptions)
Redacts the provided string.
public string RedactString(string value, StringRedactorOptions redactorOptions)Parameters
- valuestring
- The string to redact. 
- redactorOptionsStringRedactorOptions
- The redactorOptions to control redaction behavior.