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: UUIDv5 #75

Open CSenshi opened 4 years ago

CSenshi commented 4 years ago

Rule Name: UUIDv5

Rule Description: The field under validation must be a valid Universally Unique IDentifier version 5 (UUIDv5). UUIDv5 is name based uses SHA-1 for hashing

Rule Usage Example:

reqs = {'data' : '601d90d0-8611-502d-b49b-86c0779b6159'}
rule = {'data' : 'uuidv5'}
validate(reqs, rule) # True

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

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