-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
80 lines (59 loc) · 2.33 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?php
require '../src/Randomist.php';
use Wandu\Utils\Randomist;
$randomist = new Randomist();
echo "<pre>";
// Example 1: Secure password.
$secure_password = $randomist
->set_lenght(12)
->include_number(3)
->include_lowercase(3)
->include_uppercase(3)
->include_special(1, 1)
->generate();
echo "1- Secure password: {$secure_password} \n\n";
// Example 2: Multiple simple passwords.
$multiple_passwords = $randomist
->reset()
->set_lenght(8)
->include_number(4)
->include_lowercase(2)
->include_uppercase(2)
->generate(10);
echo "2- Multiple simple passwords:\n".implode("\n", $multiple_passwords)."\n\n";
// Example 3: Random hash.
$random_hash = $randomist
->reset()
->set_lenght(50, 80)
->include_number(1)
->include_lowercase(1)
->include_uppercase(1)
->generate();
echo "3- Random hash: {$random_hash}\n\n";
// Example 4: Random hash URI safe.
$random_hash_uri_safe = $randomist
->reset()
->set_lenght(30, 40)
->only_safe()
->include_number(1)
->include_lowercase(1)
->include_uppercase(1)
->include_special(1)
->generate();
echo "4- Random hash URI safe: {$random_hash_uri_safe}\n\n";
// Example 5: Random string for simple captcha.
$captcha = $randomist
->reset()
->set_lenght(5)
->include_number(1)
->include_uppercase(1)
->generate();
echo "5- Random string for simple captcha: {$captcha}\n\n";
// Example 6: Verification code.
$code = $randomist
->reset()
->set_lenght(6)
->include_number(1)
->generate();
echo "6- Verification code: {$code}\n\n";
echo "</pre>";