Skip to main content

Crate cloakrs_patterns

Crate cloakrs_patterns 

Source
Expand description

Universal PII recognizers for cloakrs.

This crate provides recognizers for email, phone, credit cards, IBAN, IP addresses, URLs, secrets, MAC addresses, crypto wallet addresses, and dates of birth.

§Examples

use cloakrs_core::EntityType;

let findings = cloakrs_patterns::default_registry().scan_all("email jane@example.com");
assert!(findings.iter().any(|finding| finding.entity_type == EntityType::Email));

Structs§

ApiKeyRecognizer
Recognizes generic API keys and bearer-style tokens with nearby key context.
AwsAccessKeyRecognizer
Recognizes AWS access key identifiers with the AKIA prefix.
CreditCardRecognizer
Recognizes credit and debit card numbers with Luhn validation.
CryptoAddressRecognizer
Recognizes common Bitcoin and Ethereum wallet address shapes.
DateOfBirthRecognizer
Recognizes dates that are likely dates of birth from nearby birth context.
EmailRecognizer
Recognizes common email addresses.
IbanRecognizer
Recognizes International Bank Account Numbers with MOD-97 validation.
IpAddressRecognizer
Recognizes IPv4 and IPv6 addresses.
JwtRecognizer
Recognizes JSON Web Tokens in header.payload.signature form.
MacAddressRecognizer
Recognizes MAC addresses in common colon, hyphen, and dotted forms.
PhoneRecognizer
Recognizes common international and North American phone numbers.
SsnRecognizer
Recognizes United States Social Security Numbers.
UrlRecognizer
Recognizes HTTP, HTTPS, FTP, and www. URLs.

Enums§

CardBrand
Known payment card brand families.

Functions§

card_brand
Identifies common payment card brand families from card digits.
default_registry
Builds a registry containing the Sprint 2 universal recognizers.
iban_country_length
Returns the expected IBAN length for supported countries.
iban_mod97_valid
Returns true when an IBAN passes ISO 13616 MOD-97 validation.
luhn_valid
Returns true when the supplied digits pass the Luhn checksum.
register_default_recognizers
Registers the Sprint 2 recognizers into an existing registry.
version
Returns the crate version.