CSenshi / Validator

Easy-to-use, Highly Configurable Python Data Validator. Inspired by Laravel Validator
https://pypi.org/project/validator/
MIT License
46 stars 23 forks source link

New Rule: UUIDv4 #74

Closed CSenshi closed 4 years ago

CSenshi commented 4 years ago

Rule Name: UUIDv4

Rule Description: The field under validation must be a valid Universally Unique IDentifier version 4 (UUIDv4). UUIDv4 is random based.

Rule Usage Example:

reqs = {'data' : '81368b76-31e9-41db-b28c-8c029cb435f0'}
rule = {'data' : 'uuidv4'}
validate(reqs, rule) # True

reqs = {'data' : 'a3bb189e-8bf9-3888-9912-ace4e6543002'}
rule = {'data' : 'uuidv4''}
validate(reqs, rule) # False, It fails because data is uuidv3

Before contributing please review RULES.md (check for duplication), also check CONTRIBUTING.md for more details :100:

dbejanishvili commented 4 years ago

I can work on that