https://github.com/richismyhoo/somevalidation
.NET Library with some validation methods
https://github.com/richismyhoo/somevalidation
csharp csharp-library dotnet library validation validation-library
Last synced: 4 months ago
JSON representation
.NET Library with some validation methods
- Host: GitHub
- URL: https://github.com/richismyhoo/somevalidation
- Owner: richismyhoo
- License: mit
- Created: 2025-02-18T02:13:29.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-22T16:47:42.000Z (over 1 year ago)
- Last Synced: 2025-09-14T05:28:28.334Z (10 months ago)
- Topics: csharp, csharp-library, dotnet, library, validation, validation-library
- Language: C#
- Homepage: https://www.nuget.org/packages/SomeValidation/
- Size: 34.2 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SomeValidation library for .NET C#
**Contributions and functionality additions to the project are welcome**
## Documentation in main directory in file doc.md
*place star if this lib was helpful!*
**this library contains some methods what resolves popular problems of validation, easy names for methods, easy to start**
### Some examples with data types
`IsValidEmail(string)`
`IsValidPhone(string)`
`IsValidPassword(string, int minLength)`*also checking for some bad symbols*
`IsValidGuid(string)`
`IsValidIPv6(string) & IsValidIPv4(string)`
`IsFileSizeValid(string filePath, string sizeWithUnit)` *accepting second string "b" bytes, "kb" - kilobytes, "mb" - megabytes, "gb" - gigabytes*
`IsSafeXSS(string)`
`IsValidVIN(string)`
`IsValidCardNumber(string)`
`IsValidMD5(string)`
*and lot more*
---
# Some examples to usage
```C#
string uuid = "550e8400-e29b-41d4-a716-446655440000";
Console.WriteLine(UUIDValidator.IsValidUUID(uuid));
```
```C#
string cardNumber = "4539 1488 0343 6467";
Console.WriteLine(CardValidator.IsValidCardNumber(cardNumber));
```
```C#
// Zone: Europe as example
double minLatitude = 35.0;
double maxLatitude = 71.0;
double minLongitude = -25.0;
double maxLongitude = 40.0;
Console.WriteLine(IsInZone(50.0, 10.0, minLatitude, maxLatitude, minLongitude, maxLongitude)); // True
Console.WriteLine(IsInZone(10.0, 10.0, minLatitude, maxLatitude, minLongitude, maxLongitude)); // False
Console.WriteLine(IsInZone(50.0, -30.0, minLatitude, maxLatitude, minLongitude, maxLongitude)); // False
```