Skip to content

Commit 9551cd8

Browse files
committed
Add doc for Hash rule
1 parent c43c104 commit 9551cd8

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ public function rules()
5252
- [`Divisible By`](#divisibleby)
5353
- [`Ethereum Address`](#ethereumaddress)
5454
- [`Float Number`](#floatnumber)
55+
- [`Hash`](#hash)
5556
- [`Image URL`](#imageurl)
5657
- [`Phone`](#phone)
5758
- [`Without Spaces`](#withoutspaces)
@@ -206,6 +207,23 @@ public function rules()
206207
}
207208
```
208209

210+
### `Hash`
211+
212+
The field under validation must be a hash of type algorithm.
213+
214+
Algorithm is one of `'md4', 'md5', 'sha1', 'sha256', 'sha384', 'sha512', 'ripemd128', 'ripemd160', 'tiger128', 'tiger160', 'tiger192', 'crc32', 'crc32b'`.
215+
216+
```php
217+
use Arifszn\AdvancedValidation\Rules\Hash;
218+
219+
public function rules()
220+
{
221+
return [
222+
'foo' => [new Hash()],
223+
];
224+
}
225+
```
226+
209227
### `ImageURL`
210228

211229
The field under validation must be a valid image URL.

0 commit comments

Comments
 (0)