./redteamer

Functions

Validation Functions

Functions for validating strings.


Email Validation

email

This function checks if a given string is formatted as an email and returns a boolean value. Input is a string (str) to validate.

val::email("test@example.com")

existing_email

This function determines if a given string is an email associated with an existing domain, returning a boolean value. Input is a string (str) to validate.

val::existing_email("test@example.com")

URL and URI Validation

data_uri

This function checks if a given string is a base64 encoded data URI, such as an image, and returns a boolean value. Input is a string (str) to validate.

val::data_uri("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...")

magnet_uri

This function verifies if a given string is a valid magnet URI and returns a boolean value. Input is a string (str) to validate.

val::magnet_uri("magnet:?xt=urn:btih:abcdefg")

request_uri

This function determines if a given string is an absolute URI or an absolute path, returning a boolean value. Input is a string (str) to validate.

val::request_uri("/path/to/resource")

url

This function checks if a given string is formatted as a URL, returning a boolean value. Input is a string (str) to validate.

val::url("https://example.com")

String and Character Validation

alpha

This function checks if a string contains only letters (a-zA-Z), including an empty string, and returns a boolean value. Input is a string (str) to validate.

val::alpha("alphaOnly")

alpha_numeric

This function determines if a string contains only letters and numbers, including an empty string, and returns a boolean value. Input is a string (str) to validate.

val::alpha_numeric("abc123")

ascii

This function checks if a string consists solely of ASCII characters, including an empty string, and returns a boolean value. Input is a string (str) to validate.

val::ascii("Hello")

has_full_width

This function verifies if a string contains any full-width characters, including an empty string, and returns a boolean value. Input is a string (str) to validate.

val::has_full_width("example")

has_half_width

This function checks if a string includes any half-width characters, including an empty string, and returns a boolean value. Input is a string (str) to validate.

val::has_half_width("example")

has_lowercase

This function confirms if a string contains at least one lowercase letter, including an empty string, and returns a boolean value. Input is a string (str) to validate.

val::has_lowercase("HasLower")

has_multibyte

This function checks if a string contains one or more multibyte characters, including an empty string, and returns a boolean value. Input is a string (str) to validate.

val::has_multibyte("こんにちは")

has_uppercase

This function verifies if a string has at least one uppercase letter, including an empty string, and returns a boolean value. Input is a string (str) to validate.

val::has_uppercase("HASupper")

has_whitespace

This function determines if a string contains any whitespace and returns a boolean value. Input is a string (str) to validate.

val::has_whitespace("Hello World")

has_whitespace_only

This function checks if a string consists only of whitespace and returns a boolean value. Input is a string (str) to validate.

val::has_whitespace_only("   ")

lowercase

This function checks if a string is entirely lowercase, including an empty string, and returns a boolean value. Input is a string (str) to validate.

val::lowercase("lowercase")

printable_ascii

This function verifies if a string contains only printable ASCII characters, including an empty string, and returns a boolean value. Input is a string (str) to validate.

val::printable_ascii("Hello, World!")

uppercase

This function checks if a string is entirely uppercase, including an empty string, and returns a boolean value. Input is a string (str) to validate.

val::uppercase("UPPERCASE")

utf_letter

This function determines if a string contains only unicode letter characters and returns a boolean value. Input is a string (str) to validate.

val::utf_letter("αβγ")

utf_letter_numeric

This function checks if a string consists solely of unicode letters and numbers, including an empty string, and returns a boolean value. Input is a string (str) to validate.

val::utf_letter_numeric("abc123αβγ")

variable_width

This function verifies if a string contains a mix of full and half-width characters, including an empty string, and returns a boolean value. Input is a string (str) to validate.

val::variable_width("example")

Numeric Validation

float

This function checks if a string represents a float, including an empty string, and returns a boolean value. Input is a string (str) to validate.

val::float("123.45")

hexadecimal

This function verifies if a string is a hexadecimal number and returns a boolean value. Input is a string (str) to validate.

val::hexadecimal("1A2B3C")

int

This function checks if a string is an integer, including an empty string, and returns a boolean value. Input is a string (str) to validate.

val::int("123")

numeric

This function determines if a string contains only numbers, including an empty string, and returns a boolean value. Input is a string (str) to validate.

val::numeric("123456")

utf_digit

This function checks if a string contains only unicode radix-10 decimal digits, including an empty string, and returns a boolean value. Input is a string (str) to validate.

val::utf_digit("١٢٣")

utf_numeric

This function verifies if a string contains only unicode numbers of any kind and returns a boolean value. Input is a string (str) to validate.

val::utf_numeric("١٢٣")

Color Validation

hex_color

This function checks if a string is a valid hexadecimal color code and returns a boolean value. Input is a string (str) to validate.

val::hex_color("#1A2B3C")

rgb_color

This function verifies if a string is a valid RGB color in the format rgb(RRR, GGG, BBB) and returns a boolean value. Input is a string (str) to validate.

val::rgb_color("rgb(255, 255, 255)")

Code and Identifier Validation

crc32

This function verifies if a string is a CRC32 hash and returns a boolean value. Input is a string (str) to validate.

val::crc32("m")

crc32b

This function checks if a string is a CRC32b hash and returns a boolean value. Input is a string (str) to validate.

val::crc32b("n")

creditcard

This function confirms if a string is a credit card number and returns a boolean value. Input is a string (str) to validate.

val::creditcard("4111111111111111")

e164

This function checks if a string is a valid E.164 formatted phone number and returns a boolean value. Input is a string (str) to validate.

val::e164("+14155552671")

imei

This function verifies if a string is a valid IMEI and returns a boolean value. Input is a string (str) to validate.

val::imei("490154203237518")

imsi

This function checks if a string is a valid IMSI and returns a boolean value. Input is a string (str) to validate.

val::imsi("310150123456789")

isbn10

This function validates if a string is an ISBN version 10 and returns a boolean value. Input is a string (str) to validate.

val::isbn10("048665088X")

isbn13

This function checks if a string is an ISBN version 13 and returns a boolean value. Input is a string (str) to validate.

val::isbn13("978-3-16-148410-0")

md4

This function verifies if a string is an MD4 hash and returns a boolean value. Input is a string (str) to validate.

val::md4("bde52cb31de33e46245e05fbdbd6fb24")

md5

This function checks if a string is an MD5 hash and returns a boolean value. Input is a string (str) to validate.

val::md5("9f7d0ee82b6a6ca7ddeae841f3253059")

mongo_id

This function confirms if a string is a valid hex-encoded representation of a MongoDB ObjectId and returns a boolean value. Input is a string (str) to validate.

val::mongo_id("507f1f77bcf86cd799439011")

ripemd128

This function checks if a string is a RIPEMD-128 hash and returns a boolean value. Input is a string (str) to validate.

val::ripemd128("l")

ripemd160

This function verifies if a string is a RIPEMD-160 hash and returns a boolean value. Input is a string (str) to validate.

val::ripemd160("i")

rsa_public_key

This function validates if a string is a valid RSA Public Key with a specified length and returns a boolean value. Input is a string (str) to validate.

val::rsa_public_key("MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A...")

semver

This function checks if a string is a valid semantic version and returns a boolean value. Input is a string (str) to validate.

val::semver("1.0.0")

sha1

This function verifies if a string is a SHA-1 hash and returns a boolean value. Input is a string (str) to validate.

val::sha1("j")

sha256

This function checks if a string is a SHA-256 hash and returns a boolean value. Input is a string (str) to validate.

val::sha256("f")

sha3224

This function confirms if a string is a SHA3-224 hash and returns a boolean value. Input is a string (str) to validate.

val::sha3224("d14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f")

sha3256

This function checks if a string is a SHA3-256 hash and returns a boolean value. Input is a string (str) to validate.

val::sha3256("a")

sha3384

This function verifies if a string is a SHA3-384 hash and returns a boolean value. Input is a string (str) to validate.

val::sha3384("b")

sha3512

This function checks if a string is a SHA3-512 hash and returns a boolean value. Input is a string (str) to validate.

val::sha3512("c")

sha384

This function verifies if a string is a SHA-384 hash and returns a boolean value. Input is a string (str) to validate.

val::sha384("e")

sha512

This function checks if a string is a SHA-512 hash and returns a boolean value. Input is a string (str) to validate.

val::sha512("d")

tiger128

This function confirms if a string is a Tiger-128 hash and returns a boolean value. Input is a string (str) to validate.

val::tiger128("k")

tiger160

This function checks if a string is a Tiger-160 hash and returns a boolean value. Input is a string (str) to validate.

val::tiger160("h")

tiger192

This function verifies if a string is a Tiger-192 hash and returns a boolean value. Input is a string (str) to validate.

val::tiger192("g")

ulid

This function checks if a string is a ULID and returns a boolean value. Input is a string (str) to validate.

val::ulid("01BX5ZZKBKACTAV9WEVGEMMVS0")

us_ssn

This function verifies if a string is a U.S. Social Security Number and returns a boolean value. Input is a string (str) to validate.

val::us_ssn("123-45-6789")

uuid

This function checks if a string is a UUID and returns a boolean value. Input is a string (str) to validate.

val::uuid("123e4567-e89b-12d3-a456-426655440000")

uuidv3

This function verifies if a string is a UUID version 3 and returns a boolean value. Input is a string (str) to validate.

val::uuidv3("123e4567-e89b-12d3-a456-426614174000")

uuidv4

This function checks if a string is a UUID version 4 and returns a boolean value. Input is a string (str) to validate.

val::uuidv4("550e8400-e29b-41d4-a716-446655440000")

uuidv5

This function verifies if a string is a UUID version 5 and returns a boolean value. Input is a string (str) to validate.

val::uuidv5("123e4567-e89b-12d3-a456-426655440000")

File and Path Validation

filepath

This function checks if a string is a valid file path for both Windows and Unix systems and returns a boolean value. Input is a string (str) to validate.

val::filepath("/usr/local/bin")

unix_filepath

This function verifies if a string is a valid Unix file path and returns a boolean value. Input is a string (str) to validate.

val::unix_filepath("/home/user")

win_filepath

This function checks if a string is a valid Windows file path and returns a boolean value. Input is a string (str) to validate.

val::win_filepath("C:\\Program Files")

Data Format Validation

base64

This function checks if a string is base64 encoded and returns a boolean value. Input is a string (str) to validate.

val::base64("SGVsbG8=")

json

This function verifies if a string is valid JSON and returns a boolean value. Input is a string (str) to validate.

val::json("{\"key\": \"value\"}")

Geographic and Language Code Validation

iso3166_alpha2

This function checks if a string is a valid two-letter country code and returns a boolean value. Input is a string (str) to validate.

val::iso3166_alpha2("US")

iso3166_alpha3

This function verifies if a string is a valid three-letter country code and returns a boolean value. Input is a string (str) to validate.

val::iso3166_alpha3("USA")

iso4217

This function checks if a string is a valid ISO currency code and returns a boolean value. Input is a string (str) to validate.

val::iso4217("USD")

iso693_alpha2

This function confirms if a string is a valid two-letter language code and returns a boolean value. Input is a string (str) to validate.

val::iso693_alpha2("en")

iso693_alpha3b

This function checks if a string is a valid three-letter language code and returns a boolean value. Input is a string (str) to validate.

val::iso693_alpha3b("eng")

latitude

This function verifies if a string is a valid latitude and returns a boolean value. Input is a string (str) to validate.

val::latitude("37.7749")

longitude

This function checks if a string is a valid longitude and returns a boolean value. Input is a string (str) to validate.

val::longitude("-122.4194")

Date and Time Validation

rfc3339

This function checks if a string is a valid timestamp according to RFC3339 and returns a boolean value. Input is a string (str) to validate.

val::rfc3339("2021-03-31T12:00:00Z")

rfc3339_without_zone

This function verifies if a string is a valid RFC3339 timestamp excluding the timezone and returns a boolean value. Input is a string (str) to validate.

val::rfc3339_without_zone("2021-03-31T12:00:00")

time

This function confirms if a string is a valid time based on the specified format and returns a boolean value. Inputs are the string (str) and the format (format) to validate against.

val::time("12:30", "HH:mm")

unixtime

This function checks if a string is a valid Unix timestamp and returns a boolean value. Input is a string (str) to validate.

val::unixtime("1617184800")

Network and Security Validation

cidr

This function checks if a string is a valid IP CIDR and returns a boolean value. Input is a string (str) to validate.

val::cidr("192.168.1.0/24")

dns

This function verifies if a string is a valid DNS name and returns a boolean value. Input is a string (str) to validate.

val::dns("example.com")

host

This function checks if a string is a valid IP or DNS address and returns a boolean value. Input is a string (str) to validate.

val::host("example.com")

ip

This function verifies if a string is either IP version 4 or 6 and returns a boolean value. Input is a string (str) to validate.

val::ip("192.168.1.1")

ipv4

This function checks if a string is a valid IPv4 address and returns a boolean value. Input is a string (str) to validate.

val::ipv4("192.168.1.1")

ipv6

This function confirms if a string is a valid IPv6 address and returns a boolean value. Input is a string (str) to validate.

val::ipv6("::1")

mac

This function checks if a string is a valid MAC address and returns a boolean value. Input is a string (str) to validate.

val::mac("00:1A:2B:3C:4D:5E")

port

This function verifies if a string is a valid IP port and returns a boolean value. Input is a string (str) to validate.

val::port("8080")
Previous
Timestamp Functions