modulepackage
1.0.9
Repository: https://github.com/threatwinds/validations.git
Documentation: pkg.go.dev
# README
validations
# Functions
GenerateSHA3256 generates a SHA3-256 hash from the given string.
ValidateAdversary validates if the given value is a valid adversary.
ValidateBase64 validates if a given string is a valid base64 encoded string.
ValidateBoolean validates if a given value is a boolean and generates a SHA3-256 hash of the value.
ValidateCIDR validates if a given string is a valid CIDR notation and returns the CIDR string and its SHA3-256 hash.
ValidateCity validates a city name by converting it to title case and generating a SHA3-256 hash.
ValidateCountry validates a given country string value by converting it to title case and generating a SHA3-256 hash.
ValidateDate validates a date string in the format "2006-01-02" and returns the formatted date string and its SHA3-256 hash.
ValidateDatetime validates a datetime string in the RFC3339Nano format and returns the formatted datetime string and its SHA3-256 hash.
ValidateEmail validates if a given string is a valid email address.
ValidateFloat validates if the given value is a float64 or an int64 that can be converted to a float64.
ValidateFQDN validates a fully qualified domain name (FQDN) string.
ValidateHexadecimal validates if the given value is a valid hexadecimal string.
ValidateInteger validates if a value is an integer and returns its int64 representation, its SHA3-256 hash and an error if the value is not an integer.
ValidateIP validates if the given IP address is valid and not private, multicast, loopback, or unspecified.
ValidateMAC validates if a given string is a valid MAC address and returns the MAC address in uppercase and its SHA3-256 hash.
ValidateMD5 validates if a given string is a valid MD5 hash.
ValidateMime validates if a given string is a valid MIME type and returns the validated string, its SHA3-256 hash and an error if any.
ValidateObject validates an object by checking if it's a valid UUID, MD5 or SHA3256 hash.
ValidatePath validates if the given value is a valid path and returns the path in lowercase and its SHA3-256 hash.
ValidatePhone validates a phone number and returns the validated phone number and its SHA3-256 hash.
ValidatePort validates a port with protocol.
ValidateRegEx validates if a given value matches a regular expression.
ValidateRegexComp validates if a given value is a valid regular expression.
ValidateSHA1 validates if a given value is a valid SHA1 hash.
ValidateSHA224 validates if a given string is a valid SHA-224 hash and returns the hash in lowercase and its SHA3-256 hash.
ValidateSHA256 validates that a given value is a valid SHA256 hash.
ValidateSHA3224 validates if a given string is a valid SHA3-224 hash and returns the hash in lowercase and its SHA3-256 hash.
ValidateSHA3256 validates if the given value is a valid SHA3-256 hash.
ValidateSHA3256 validates if a given string is a valid SHA3-256 hash and returns the hash in lowercase and its SHA3-256 hash.
ValidateSHA3512 validates if a given string is a valid SHA3-512 hash and returns the hash in lowercase and its SHA3-256 hash.
ValidateSHA384 validates a string value as a SHA384 hash and returns the hash value, its SHA3256 hash, and an error if any.
ValidateSHA512 validates if a given value is a valid SHA512 hash.
ValidateSHA512224 validates if a given value is a valid SHA512/224 hash.
ValidateSHA512256 validates that a given value is a valid SHA512-256 hash.
ValidateString validates a string value and returns the original value, its SHA3-256 hash and an error.
ValidateURL validates a given URL string and returns the URL in lowercase and its SHA3-256 hash.
ValidateUUID validates if a given value is a valid UUID string and returns the UUID, its SHA3-256 hash and an error if any.
No description provided by the author
# Constants
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Variables
No description provided by the author