Skip to content
Pieter Hordijk edited this page Dec 31, 2018 · 1 revision

TOC

HashMatches

Validates the input (string) to match against a hash (string).

Version information

Available since: 1.0.0

Usage

<?php declare(strict_types);

use HarmonyIO\Validation\Rule\Hash\HashMatches;

(new HashMatches('dd74d182c641e4c78502d863b44d0aeff1575e54'))->validate('dd74d182c641e4c78502d863b44d0aeff1575e54');

Failure reasons

  • Type.String when the validated value is not a string
  • Hash.HashMatches when the validated value does not match the hash

PasswordMatches

Validates the input password (string) to match against a password hash (string).

Version information

Available since: 1.0.0

Usage

<?php declare(strict_types);

use HarmonyIO\Validation\Rule\Hash\PasswordMatches;

(new PasswordMatches('Validation'))->validate('$2y$14$7LWPEV9UaIA6dUFfLcquIOi0MvxlyYAE2wqETRltB6.2cxoWK4cJW');

Failure reasons

  • Type.String when the validated value is not a string
  • Hash.PasswordMatches when the validated password does not match the hash
Clone this wiki locally