en-decodeerder-algoritme
Gesponsorde koppelingen
PHP script bestanden
Code (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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<?php
class Encoding_Algoritme
{
public function encode ($string)
{
$strlen = strlen ($string);
$strnew = '';
$strarr = array (
'a' => '1',
'b' => '9',
'c' => '8',
'd' => '5',
'e' => '3',
'f' => '4',
'g' => 'f',
'h' => '7',
'i' => 'n',
'j' => 'h',
'k' => 'x',
'l' => '0',
'm' => 'o',
'n' => '2',
'o' => 'b',
'p' => 'c',
'q' => 'd',
'r' => 'e',
's' => 'i',
't' => 'g',
'u' => 'v',
'v' => 'm',
'w' => 'p',
'x' => '6',
'y' => 'j',
'z' => 'r',
'1' => 'k',
'2' => 'a',
'3' => 'u',
'4' => 'w',
'5' => 'l',
'6' => 's',
'7' => 'z',
'8' => 'q',
'9' => 't',
'0' => 'y'
);
for ($i = 0; $i < $strlen; ++$i)
$strnew .= $strarr[$string{$i}];
return $strnew;
}
public function decode ($string)
{
$strlen = strlen ($string);
$strnew = '';
$strarr = array (
'z' => '7',
'y' => '0',
'x' => 'k',
'w' => '4',
'v' => 'u',
'u' => '3',
't' => '9',
's' => '6',
'r' => 'z',
'q' => '8',
'p' => 'w',
'o' => 'm',
'n' => 'i',
'm' => 'v',
'l' => '5',
'k' => '1',
'j' => 'y',
'i' => 's',
'h' => 'j',
'g' => 't',
'f' => 'g',
'e' => 'r',
'd' => 'q',
'c' => 'q',
'b' => 'o',
'a' => '2'
'1' => 'a',
'2' => 'n',
'3' => 'e',
'4' => 'f',
'5' => 'd',
'6' => 'x',
'7' => 'h',
'8' => 'c',
'9' => 'b',
'0' => 'l'
);
for ($i = 0; $i < $strlen; ++$i)
$strnew .= $strarr[$string{$i}];
return $strnew;
}
}
?>
class Encoding_Algoritme
{
public function encode ($string)
{
$strlen = strlen ($string);
$strnew = '';
$strarr = array (
'a' => '1',
'b' => '9',
'c' => '8',
'd' => '5',
'e' => '3',
'f' => '4',
'g' => 'f',
'h' => '7',
'i' => 'n',
'j' => 'h',
'k' => 'x',
'l' => '0',
'm' => 'o',
'n' => '2',
'o' => 'b',
'p' => 'c',
'q' => 'd',
'r' => 'e',
's' => 'i',
't' => 'g',
'u' => 'v',
'v' => 'm',
'w' => 'p',
'x' => '6',
'y' => 'j',
'z' => 'r',
'1' => 'k',
'2' => 'a',
'3' => 'u',
'4' => 'w',
'5' => 'l',
'6' => 's',
'7' => 'z',
'8' => 'q',
'9' => 't',
'0' => 'y'
);
for ($i = 0; $i < $strlen; ++$i)
$strnew .= $strarr[$string{$i}];
return $strnew;
}
public function decode ($string)
{
$strlen = strlen ($string);
$strnew = '';
$strarr = array (
'z' => '7',
'y' => '0',
'x' => 'k',
'w' => '4',
'v' => 'u',
'u' => '3',
't' => '9',
's' => '6',
'r' => 'z',
'q' => '8',
'p' => 'w',
'o' => 'm',
'n' => 'i',
'm' => 'v',
'l' => '5',
'k' => '1',
'j' => 'y',
'i' => 's',
'h' => 'j',
'g' => 't',
'f' => 'g',
'e' => 'r',
'd' => 'q',
'c' => 'q',
'b' => 'o',
'a' => '2'
'1' => 'a',
'2' => 'n',
'3' => 'e',
'4' => 'f',
'5' => 'd',
'6' => 'x',
'7' => 'h',
'8' => 'c',
'9' => 'b',
'0' => 'l'
);
for ($i = 0; $i < $strlen; ++$i)
$strnew .= $strarr[$string{$i}];
return $strnew;
}
}
?>