particle-php / Validator

Particle\Validator is a validation library with an extremely clean API which makes validation fun!
http://validator.particle-php.com
252 stars 39 forks source link

Hash rule is not what it tells you it is #193

Open RobQuistNL opened 5 years ago

RobQuistNL commented 5 years ago

What

The hash rule actually validates against a hexidecimal string representation of a hash. You might want to add that in the name, because in essence the hashes named are just a bunch of bits / bytes. The fact that PHP represents most in hex doesn't mean that something is a valid / invalid hash.

What is expected

Rename it to HashRepresentation($hash_algo, Hash::HEXIDECIMAL_INSENSITIVE) or something, indicating that you're validating a hexidecimal representation of a hash.