[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

A simple validator library for various things, such as email, credit card, ISBN and more

License

Notifications You must be signed in to change notification settings

DevyusCode/XValid

Repository files navigation

XValid - A Simple Validator Library

GitHub contributors GitHub issues GitHub GitHub Workflow Status GitHub release (latest SemVer)



Logo

XValid

A simple validator library for various things, such as coordinates, credit cards, domain names, emails, IBANs, IP addresses, ISBNs, and more.
View documentation »
Report Bug · Request Feature · Known Issues

Features

  • Validate coordinates.
  • Validate credit card numbers.
  • Validate domain names.
  • Validate email addresses.
  • Validate IBANs.
  • Validate IP addresses.
  • Validate ISBNs.
  • More features are planned for future releases.

How to Use

  1. Install XValid via NuGet using the following command:
Install-Package XValid

or

dotnet add package XValid
  1. Import the XValid namespace in your C# code.

  2. Start validating!

Coordinate Validation

using XValid;

double latitude = 40.7128; // Example latitude
double longitude = -74.0060; // Example longitude
bool isValidCoordinate = CoordinateValidator.IsValidCoordinate(latitude, longitude);

Credit Card Validation

using XValid;

string creditCardNumber = "4111 1111 1111 1111"; // Example card number (Visa)
bool isValidCreditCard = CreditCardValidator.IsValidCreditCardNumber(creditCardNumber);

Domain Name Validation

using XValid;

string domainName = "example.com";
bool isValidDomainName = DomainNameValidator.IsValid(domainName);

Email Validation

using XValid;

string email = "user@example.com";
bool isValidEmail = EmailValidator.IsValidEmail(email);

IBAN Validation

using XValid;

string iban = "DE89370400440532013000"; // Example IBAN (Germany)
bool isValidIBAN = IBANValidator.IsValidIBAN(iban);

IP Address Validation

using XValid;

string ipAddress = "192.0.2.1"; // Example IP address
bool isValidIPAddress = IPAddressValidator.IsValidIPAddress(ipAddress);

ISBN Validation

using XValid;

string isbn = "978-3-16-148410-0";
bool isValidISBN = ISBNValidator.IsValidISBN(isbn);

Contribution Guidelines

To contribute to XValid, follow these steps:

  1. Ensure you have the following tools installed:
    • Visual Studio 2022 v17.0 or higher
    • .NET 6.0 SDK
    • Git
    • .NET 6
  2. Fork the XValid repository and clone it to your local machine.
  3. Make your changes or add new features.
  4. Write tests to ensure the changes are functioning as expected.
  5. Submit a pull request to the main repository.

For more detailed guidelines, check out the contribution guidelines.

License

This project is under the MIT License.