Skip to contents

Redacts credit card numbers from a given string

Usage

redact_creditcardnumber(
  string,
  hash_spotted = FALSE,
  replace_with = "CREDITCARD"
)

Arguments

string

A character vector with, at most, one element. The input string to redact credit card numbers from

hash_spotted

When TRUE, the redaction of the credit cards will be a hash of the redacted (Default False)

replace_with

A character vector with, at most, one element. When hash_spotted is FALSE, this character vector will be the replacement redacted credit card numbers.

Value

A character vector.

Examples

x <- "You can use my 5567554868135971 here"
redact_creditcardnumber(x)
#> [1] "You can use my CREDITCARD here"