blib/lib/TXTCOD.pm

filter: Statementstmt 0.8% 2 / 237 Branchbran 0.0% 0 / 78 Conditioncond 0.0% 0 / 21 MC/DCmcdc 0.0% 0 / 11 Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 6 totaltotal 0.5% 2 / 359 CC 59 SCAR 65.7
CC
59
Cov
1%
codage
812.0
decodage
812.0
createcod
30.0
CRAP 712.9
↑ Summary
1 package TXTCOD;
2  
3 =head1 NAME
4  
5 TXTCOD - Encoding module using the SAC system.
6  
7 =head1 SYNOPSIS
8  
9 use TXTCOD;
10
11 TXTCOD::codage($source,
12 $destination,
13 <$file.cod>,
14 <$algorithm.alc>,
15 <$param>);
16
17 $param = TXTCOD::decodage($source,
18 $destination,
19 $file.cod,
20 <$algorithm.alc>);
21 $file.cod = TXTCOD::createcod;
22  
23 =head1 DESCRIPTION
24  
25 TXTCOD 4.7 encodes files with the SAC system, 2.4 version..
26 The SAC system consists in several algorithms : a default algorithm who can be remplaced by user-written algorithms. Every algorithm uses a .cod file generated by the module and who contains a list of random numbers used by the module in order to ensure a maximal protection.
27 B<< A file must be encoded with the same algorithm and the same .cod file !!! . >>
28 This version of the SAC system can encode any type of file (binary files, text) and recognizes automatically their type.
29  
30 In the first part you will see the module's how-to and in the second part how to program an algorithm.
31  
32 =head1 FIRST PART : TXTCOD Module
33  
34 These functions will be accessible after you have typed B<< use TXTCOD; >>
35  
36  
37 =head2 1) Encoding
38  
39 You call the encoding function by typing :
40 TXTCOD::codage($source,
41 $destination,
42 <$file.cod>,
43 <$algorithm.alc>,
44 <$param>);
45 This function doesn't return any value.
46
47 $source is the file you want to encode.
48 $destination is the file where TXTCOD will send the result of the encoding.
49 These two parameters are B<< obligatory >>.
50
51 $file.cod is the .cod file who is indispensable for the encoding and the decoding. If you don't specify this parameter, will search a "[year].cod" file, for example "2003.cod". A .cod file MUST be changed every year at least in order to assure an optimal protection.
52
53 $algorithm.alc is the used algorithm. If you don't put anything, TXTCOD will use the default algorithm.
54
55 $param is an user-defined parameter who won't be crypted.
56  
57 =head2 2) Decoding
58  
59 You call the decoding function by typing :
60 $param = TXTCOD::decodage($source,
61 $destination,
62 $file.cod,
63 <$algorithm.alc>);
64  
65 $source in the file you want to decode.
66 $destination is the result of the decoding
67 $file.cod et $algorithm.alc -> see the encoding function description.
68 The returned value is the parameter you optionnally defined while the encoding and which isn't crypted.
69  
70 =head2 3) .cod files creation
71  
72 To create a .cod file type :
73 $file.cod = TXTCOD::createcod;
74 The returned value is the file's name ("[year].cod")
75
76 =head1 SECOND PART : algorithms
77  
78 Writing an algorithm is simple : create a file ended by ".alc". This file will contain one-line commands who will tell the module the way to encode and decode your files.
79 =head2 1) encoding
80 The first part of the file will contain the encoding algorithm.
81 This algorithm will have a few variables :
82 - X, each encoded letter
83 - A,B,C,D,E,F,G,H,I,J, script-defined variables.
84 - T,M,P more secured variables
85 There are many operators :
86 - addition: "+"
87 - subtraction: "-"
88 - multiplication: "*"
89 - division: "/"
90 - power: "**"
91 For example, we'll use the line : "X*(A+2)" in order to multiply the variable by (A+2). The compilation will be done internally by the module
92
93 =head2 2) decoding
94 After the encoding part of the file, we will put a line containing only the word "end" without any blank or invisible character. After this word there is the decoding part. The variables of this part are the same thn in the first part.
95 For example, if in the first part you put "X*(M+2)" you will type in the second part "X/(M+2)" in order to make the X variable becoming what she were before the encoding
96 The root is done by this operation : for a "X**A" in the first part you will put "X**(1/A)" in the second.
97
98 =head2 3) comments
99 You can comment your algorithm by any line beginning with a sharp #.
100 =head2 4) Notes
101 You should not do operations who will make mubers (initial numbers up to 255) becoming too small or too big : perl will round the final numbers and the decoded letter will be very approximative.
102  
103 =head1 TO DO
104  
105 * increase the velocity of the users' algorithm which is REALLY slower than the default algorithm :(
106 * correct my poor english faults ;) and comment the script in english
107  
108 =cut
109  
110 1 $VERSION = 4.71;
111  
112 0 ▶sub codage{
Subroutine codage: not called CC=28 SCAR=67.0
Pod undocumented
113  
114 0 $fic_sou = shift;#fichier source
115 0 $fic_dest = shift;#fichier de destination
116  
117 0 $annee = (gmtime(time))[5] + 1900;#recherche de l'annŽe
118 0 $codingfile = shift;#fichier .cod
119 0 ▶if(!$codingfile || $codingfile == "" || $codingfile == 0){
Branch: 1 branch
BranchTrueFalseTotal
if (not $codingfile or $codingfile == "" or $codingfile == 0) 0 0 0
Condition0%0/6
not $codingfile or $codingfile == "" or $codingfile == 0
l!l&&r!l&&!r
000
not $codingfile or $codingfile == ""
l!l&&r!l&&!r
000
MC/DC0%0/3
not $codingfile or $codingfile == "" or $codingfile == 0
not $codingfile $codingfile == "" $codingfile == 0
Truth table0%0/4
not(A) or B or C
A= not $codingfileB= $codingfile == ""C= $codingfile == 0
ABCresult
1XX1
01X1
0011
0000
120 0 $codingfile = "$annee.cod";
121 }
122  
123 0 ▶$algorithm = shift || "";
Condition0%0/2
shift() || ''
l!l
00
MC/DC0%0/1
shift() || ''
shift()
Truth table0%0/2
A
A= shift()
Aresult
11
00
124  
125 0 ▶$is_binary = (-B $fic_sou) || 0;
Condition0%0/2
-B $fic_sou || 0
l!l
00
MC/DC0%0/1
-B $fic_sou || 0
-B $fic_sou
Truth table0%0/2
A
A= -B $fic_sou
Aresult
11
00
126 0 ▶$old_name = shift || $fic_sou;
Condition0%0/3
shift() || $fic_sou
l!l&&r!l&&!r
000
MC/DC0%0/2
shift() || $fic_sou
shift() $fic_sou
Truth table0%0/3
A || B
A= shift()B= $fic_sou
ABresult
1X1
011
000
127  
128 0 ▶open(FICSOU, "<", $fic_sou) || die "Error: $!";
Branch: 1 branch
BranchTrueFalseTotal
open FICSOU, "<", $fic_sou or die "Error: $!" 0 0 0
129  
130 0 ▶if($is_binary == 1){ binmode FICSOU; } #le fichier est un fichier binaire
Branch: 1 branch
BranchTrueFalseTotal
if ($is_binary == 1) 0 0 0
131  
132 0 @text2conv = (); # initialisation du tableau général
133 0 my $buf;
134 0 ▶while (sysread(FICSOU, $buf, 1024)){
Branch: 1 branch
BranchTrueFalseTotal
if (sysread FICSOU, $buf, 1024) 0 0 0
135 0 push @text2conv, $buf; # lecture dans le fichier de lecture
136 }
137 0 close FICSOU; # Fermeture du fichier de lecture
138  
139 # encryptage
140  
141 #****************CHARGEMENT DU SYSTEME DE CODAGE********************#
142 # Le script lit le fichier de codage spŽcifiŽ pour coder le fichier
143  
144 0 open(CODINGFILE, "$codingfile");
145  
146 0 $count = 1;
147  
148 0 @codejours = ();
149 0 @codejourm = ();
150 0 @codemois = ();
151 0 $codeannee = 0;
152  
153 0 foreach $x (<CODINGFILE>){
154 0 chomp($x);
155 0 ▶ if($count <= 7){
Branch: 4 branches
BranchTrueFalseTotal
if ($count <= 7) { } 0 0 0
elsif ($count <= 38) { } 0 0 0
elsif ($count <= 50) { } 0 0 0
elsif ($count <= 51) { } 0 0 0
156 0 push @codejours, $x;
157 }
158 elsif($count <= 38){
159 0 push @codejourm, $x;
160 }
161 elsif($count <= 50){
162 0 push @codemois, $x;
163 }
164 elsif($count <= 51){
165 0 $codeannee = $x;
166 }
167 0 $count++;
168 }
169  
170 0 close CODINGFILE;
171  
172 0 $jours = (gmtime(time))[6];
173 0 $jourm = (gmtime(time))[3];
174 0 $mois = (gmtime(time))[4];
175  
176 0 $thiscodejours = $codejours[$jours];
177 0 $thiscodejourm = $codejourm[$jourm];
178 0 $thiscodemois = $codemois[$mois];
179 0 $thiscodeannee = $codeannee;
180  
181 0 $nbrmodifcod1 = $thiscodejours + 1;
182 0 $nbrmodifcod2 = $thiscodejourm + 1;
183 0 $nbrmodifcod3 = int($thiscodemois / 100) + 1;
184 0 $nbrmodifcod4 = int($thiscodejourm / 9) + 1;
185 0 $nbrmodifcod5 = int($thiscodemois / 94) + 1;
186 0 $nbrmodifcod6 = int($thiscodeannee / 125) + 1;
187 0 $nbrmodifcod7 = int($thiscodejours + 3) + 1;
188 0 $nbrmodifcod8 = int($thiscodejourm + 13) + 1;
189 0 $nbrmodifcod9 = int($thiscodejours + 4) + 1;
190 0 $nbrmodifcod10 = int($thiscodeannee + 73) + 1;
191  
192  
193 #*****************************SYSTEME DE CODAGE CHARGE*******************#
194 0 $time = time;
195 #***************************CHARGEMENT DE L'ALGORITHME*******************#
196 0 $algo = "";
197 0 ▶unless($algorithm eq ""){
Branch: 1 branch
BranchTrueFalseTotal
unless ($algorithm eq "") 0 0 0
198 0 ▶ open (ALGO, "$algorithm") || die "Algorithme $algorithm inexistant";
Branch: 1 branch
BranchTrueFalseTotal
open ALGO, "$algorithm" or die "Algorithme $algorithm inexistant" 0 0 0
199 0 foreach (<ALGO>){
200 0 chomp;
201 0 ▶ last if $_ eq "end";
Branch: 1 branch
BranchTrueFalseTotal
if $_ eq "end" 0 0 0
202 0 ▶ next if $_ =~ /^\#/;
Branch: 1 branch
BranchTrueFalseTotal
if $_ =~ /^\#/ 0 0 0
203 0 ▶ next if $_ eq "";
Branch: 1 branch
BranchTrueFalseTotal
if $_ eq "" 0 0 0
204 0 ▶ $_ =~ s/X/(\$lettre)/gmo if $algo eq "";
Branch: 1 branch
BranchTrueFalseTotal
if $algo eq "" 0 0 0
205 0 ▶ $_ =~ s/X/($algo)/gmo if $algo ne "";
Branch: 1 branch
BranchTrueFalseTotal
if $algo ne "" 0 0 0
206 0 $_ =~ s/A/($nbrmodifcod1)/gmo;
207 0 $_ =~ s/B/($nbrmodifcod2)/gmo;
208 0 $_ =~ s/C/($nbrmodifcod3)/gmo;
209 0 $_ =~ s/D/($nbrmodifcod4)/gmo;
210 0 $_ =~ s/E/($nbrmodifcod5)/gmo;
211 0 $_ =~ s/F/($nbrmodifcod6)/gmo;
212 0 $_ =~ s/G/($nbrmodifcod7)/gmo;
213 0 $_ =~ s/H/($nbrmodifcod8)/gmo;
214 0 $_ =~ s/I/($nbrmodifcod9)/gmo;
215 0 $_ =~ s/J/($nbrmodifcod10)/gmo;
216 0 $_ =~ s/T/(\$phrs_cnt)/gmo;
217 0 $_ =~ s/P/(\$mots_cnt)/gmo;
218 0 $_ =~ s/M/(\$lettres_cnt)/gmo;
219 0 $algo = $_;
220 }
221 0 close ALGO;
222 }
223  
224 0 @mots = ();
225 0 @lettres = ();
226  
227 0 $phrs_cnt = 1;
228 0 $mots_cnt = 1;
229 0 $lettres_cnt = 1;
230  
231 0 @tout = ();
232 0 @total = ();
233  
234  
235 0 ▶open(FICDEST, ">$fic_dest") || die "$!";
Branch: 1 branch
BranchTrueFalseTotal
open FICDEST, ">$fic_dest" or die "$!" 0 0 0
236 0 print FICDEST $jours. " " . $jourm . " " . $mois . " " . $annee . " " . $is_binary . " " . $old_name ."\n";
237  
238 0 foreach $phr (@text2conv){
239 0 $mots_cnt = 1;
240 0 @mots = $phr =~ m/([\s|\S]{1,7})/gm;
241  
242 0 foreach $mot (@mots) {
243 0 $lettres_cnt = 1;
244 0 @lettres = split //, $mot;
245  
246 0 foreach $lettre (@lettres){
247 0 $lettre = ord($lettre);
248 0 ▶ if($algorithm eq ""){ &defcodalgo }
Branch: 1 branch
BranchTrueFalseTotal
if ($algorithm eq '') { } 0 0 0
249 else{
250 0 $lettre = (eval $algo);
251 }
252  
253 0 print FICDEST $lettre . "~"; # rentre le chiffre correspondant à la lettre et ~(signifiant la fin de lettre)
254 0 $lettres_cnt++;
255 }
256 0 print FICDEST "|";
257 0 $mots_cnt++;
258 }
259 0 print FICDEST "\n";
260 0 $phrs_cnt++;
261 }#**************************************FIN SECONDE BOUCLE*********************************#
262  
263 0 close FICDEST;
264  
265 0 print ($time-time)/1000;
266  
267 } # fin codage
268  
269 0 ▶sub decodage{
Subroutine decodage: not called CC=28 SCAR=67.0
Pod undocumented
270  
271 0 $fic_sou = shift;#fichier source
272 0 $fic_dest = shift;#fichier de destination
273  
274 0 ▶open(FICSOU, $fic_sou) || die "Error: $!";
Branch: 1 branch
BranchTrueFalseTotal
open FICSOU, $fic_sou or die "Error: $!" 0 0 0
275 0 @text2conv = (); # initialisation du tableau général
276 0 $firstline = <FICSOU>;
277 0 foreach $line (<FICSOU>){
278 0 chomp($line);
279 0 push @text2conv, $line; # lecture dans le fichier de lecture
280 }
281 0 close FICSOU; # Fermeture du fichier de lecture
282  
283 0 chomp($firstline);
284 0 ($jours, $jourm, $mois, $annee, $is_binary, $old_name) = split / /, $firstline;
285 0 $codingfile = shift;#fichier .cod
286 0 ▶if(!$codingfile || $codingfile == "" || $codingfile == 0){
Branch: 1 branch
BranchTrueFalseTotal
if (not $codingfile or $codingfile == "" or $codingfile == 0) 0 0 0
Condition0%0/6
not $codingfile or $codingfile == "" or $codingfile == 0
l!l&&r!l&&!r
000
not $codingfile or $codingfile == ""
l!l&&r!l&&!r
000
MC/DC0%0/3
not $codingfile or $codingfile == "" or $codingfile == 0
not $codingfile $codingfile == "" $codingfile == 0
Truth table0%0/4
not(A) or B or C
A= not $codingfileB= $codingfile == ""C= $codingfile == 0
ABCresult
1XX1
01X1
0011
0000
287 0 $codingfile = "$annee.cod";
288 }
289  
290 0 ▶$algorithm = shift || "";
Condition0%0/2
shift() || ''
l!l
00
MC/DC0%0/1
shift() || ''
shift()
Truth table0%0/2
A
A= shift()
Aresult
11
00
291  
292 #****************CHARGEMENT DU SYSTEME DE DECODAGE********************#
293 # Le script lit le fichier de deccodage correspondant à l'année pour coder le fichier
294  
295 0 ▶open(CODINGFILE, "$codingfile") || die "Erreur (ouverture $codingfile): $!";
Branch: 1 branch
BranchTrueFalseTotal
open CODINGFILE, "$codingfile" or die "Erreur (ouverture $codingfile): $!" 0 0 0
296  
297 0 $count = 1;
298  
299 0 @codejours = ();
300 0 @codejourm = ();
301 0 @codemois = ();
302 0 $codeannee = 0;
303  
304 0 foreach $x (<CODINGFILE>){
305 0 chomp($x);
306 0 ▶ if($count <= 7){
Branch: 4 branches
BranchTrueFalseTotal
if ($count <= 7) { } 0 0 0
elsif ($count <= 38) { } 0 0 0
elsif ($count <= 50) { } 0 0 0
elsif ($count <= 51) { } 0 0 0
307 0 push @codejours, $x;
308 }
309 elsif($count <= 38){
310 0 push @codejourm, $x;
311 }
312 elsif($count <= 50){
313 0 push @codemois, $x;
314 }
315 elsif($count <= 51){
316 0 $codeannee = $x;
317 }
318 0 $count++;
319 }
320  
321 0 close CODINGFILE;
322  
323 0 $goodcodejours = $codejours[$jours];
324 0 $goodcodejourm = $codejourm[$jourm];
325 0 $goodcodemois = $codemois[$mois];
326 0 $goodcodeannee = $codeannee;
327  
328 0 $nbrmodifdec1 = $goodcodejours + 1;
329 0 $nbrmodifdec2 = $goodcodejourm + 1;
330 0 $nbrmodifdec3 = int($goodcodemois / 100) + 1;
331 0 $nbrmodifdec4 = int($goodcodejourm / 9) + 1;
332 0 $nbrmodifdec5 = int($goodcodemois / 94) + 1;
333 0 $nbrmodifdec6 = int($goodcodeannee / 125) + 1;
334 0 $nbrmodifdec7 = int($goodcodejours + 3) + 1;
335 0 $nbrmodifdec8 = int($goodcodejourm + 13) + 1;
336 0 $nbrmodifdec9 = int($goodcodejours + 4) + 1;
337 0 $nbrmodifdec10 = int($goodcodeannee + 73) + 1;
338 #*****************************SYSTEME DE DECODAGE CHARGE*******************#
339 #***************************CHARGEMENT DE L'ALGORITHME*******************#
340 0 $algo = ();
341 0 ▶unless($algorithm eq ""){
Branch: 1 branch
BranchTrueFalseTotal
unless ($algorithm eq "") 0 0 0
342 0 ▶ open (ALGO, "$algorithm") || die "Algorithme $algorithm inexistant";
Branch: 1 branch
BranchTrueFalseTotal
open ALGO, "$algorithm" or die "Algorithme $algorithm inexistant" 0 0 0
343 0 foreach (<ALGO>){
344 0 chomp;
345 0 ▶ $test = 2 if $test == 1;
Branch: 1 branch
BranchTrueFalseTotal
if $test == 1 0 0 0
346 0 ▶ $test = 1 if $_ eq "end";
Branch: 1 branch
BranchTrueFalseTotal
if $_ eq "end" 0 0 0
347 0 ▶ next unless $test == 2;
Branch: 1 branch
BranchTrueFalseTotal
unless $test == 2 0 0 0
348 0 ▶ next if $_ =~ /^\#/;
Branch: 1 branch
BranchTrueFalseTotal
if $_ =~ /^\#/ 0 0 0
349 0 ▶ next if $_ eq "";
Branch: 1 branch
BranchTrueFalseTotal
if $_ eq "" 0 0 0
350 0 ▶ $_ =~ s/X/(\$lettre)/gmo if $algo eq "";
Branch: 1 branch
BranchTrueFalseTotal
if $algo eq "" 0 0 0
351 0 ▶ $_ =~ s/X/($algo)/gmo if $algo ne "";
Branch: 1 branch
BranchTrueFalseTotal
if $algo ne "" 0 0 0
352 0 $_ =~ s/A/($nbrmodifdec1)/gmo;
353 0 $_ =~ s/B/($nbrmodifdec2)/gmo;
354 0 $_ =~ s/C/($nbrmodifdec3)/gmo;
355 0 $_ =~ s/D/($nbrmodifdec4)/gmo;
356 0 $_ =~ s/E/($nbrmodifdec5)/gmo;
357 0 $_ =~ s/F/($nbrmodifdec6)/gmo;
358 0 $_ =~ s/G/($nbrmodifdec7)/gmo;
359 0 $_ =~ s/H/($nbrmodifdec8)/gmo;
360 0 $_ =~ s/I/($nbrmodifdec9)/gmo;
361 0 $_ =~ s/J/($nbrmodifdec10)/gmo;
362 0 $_ =~ s/T/(\$phrs_cnt)/gmo;
363 0 $_ =~ s/P/(\$mots_cnt)/gmo;
364 0 $_ =~ s/M/(\$lettres_cnt)/gmo;
365 0 $algo = $_;
366 }
367 0 close ALGO;
368 }
369  
370  
371 0 @mots = ();
372 0 @lettres = ();
373  
374 0 $phrs_cnt = 1;
375 0 $mots_cnt = 1;
376 0 $lettres_cnt = 1;
377  
378 # décryptage
379  
380 0 $pourlesmots = ""; #pour stocker les lettres
381 0 @total = ();
382  
383 0 open(FICDEST, ">", "$fic_dest");
384  
385 0 ▶if($is_binary == 1){ binmode FICDEST; } #le fichier est un fichier binaire
Branch: 1 branch
BranchTrueFalseTotal
if ($is_binary == 1) 0 0 0
386  
387 #**************************************BOUCLE UNIQUE: CHANGEMENTS LETTRE PAR LETTRE*********************************#
388 0 foreach $phr (@text2conv){
389 0 $mots_cnt = 1;
390 0 @mots = split /\|/, $phr;
391
392 0 foreach $mot (@mots) {
393 0 $lettres_cnt = 1;
394 0 @lettres = split /\~/, $mot;
395  
396 0 foreach $lettre (@lettres){
397  
398 0 ▶ if($algorithm eq ""){ &defdecalgo }
Branch: 1 branch
BranchTrueFalseTotal
if ($algorithm eq '') { } 0 0 0
399 else{
400 0 $lettre = (eval $algo);
401 }
402  
403 #**************************************TRANSFORMATION EN LETTRES*********************************#
404 0 $lettre .= "!";
405 0 chop $lettre;
406 0 $lettre = chr($lettre);
407 0 print FICDEST $lettre;
408 0 $lettres_cnt++;
409 }
410 0 $mots_cnt++;
411 }
412 0 $phrs_cnt++;
413 }#**************************************FIN BOUCLE UNIQUE*********************************#
414  
415 0 close FICDEST;
416  
417 0 return $old_name;
418  
419 } # fin decodage
420  
421 0 ▶sub createcod{
Subroutine createcod: not called CC=5 SCAR=34.0
Pod undocumented
422 0 $file = (gmtime(time))[5]+1900 . ".cod";
423  
424 0 ▶ open (FILEOPENED, ">$file") || destructscript("Le fichier n'a pas pu être créé");
Branch: 1 branch
BranchTrueFalseTotal
open FILEOPENED, ">$file" or destructscript("Le fichier n'a pas pu \352tre cr\351\351") 0 0 0
425 0 ▶ for($a = 1;$a <= 7;$a++){
Branch: 1 branch
BranchTrueFalseTotal
if ($a <= 7) 0 0 0
426  
427 0 print FILEOPENED int(rand(9) + 1), "\n" || destructscript("Le fichier ne peut pas être écrit");
428  
429 }
430  
431 0 ▶ for($a = 1;$a <= 31;$a++){
Branch: 1 branch
BranchTrueFalseTotal
if ($a <= 31) 0 0 0
432  
433 0 print FILEOPENED int(rand(99) + 1), "\n" || destructscript("Le fichier ne peut pas être écrit");
434  
435 }
436  
437 0 ▶ for($a = 1;$a <= 12;$a++){
Branch: 1 branch
BranchTrueFalseTotal
if ($a <= 12) 0 0 0
438  
439 0 print FILEOPENED int(rand(999) + 1), "\n" || destructscript("Le fichier ne peut pas être écrit");
440  
441 }
442  
443 0 print FILEOPENED int(rand(9999) + 1), "\n" || destructscript("Le fichier ne peut pas être écrit");
444  
445 0 ▶ sub destructscript{
Subroutine destructscript: not called CC=1 SCAR=6.9
Pod undocumented
446 0 die "Erreur dans la création de fichier.cod: ", shift, " (erreur système: $!)";
447 }
448  
449 0 close FILEOPENED;
450 0 return $file;
451  
452 }
453  
454 0 ▶sub defcodalgo{
Subroutine defcodalgo: not called CC=1 SCAR=6.9
Pod undocumented
455 0 $lettre += $nbrmodifcod1;
456 0 $lettre *= (($mots_cnt + 1) * $nbrmodifcod2);
457 0 $lettre *= $nbrmodifcod3;
458 0 $lettre *= $nbrmodifcod4;
459 0 $lettre += (($lettres_cnt + 1) * $nbrmodifcod5);
460 0 $lettre -= $nbrmodifcod6;
461 0 $lettre *= $nbrmodifcod7;
462 0 $lettre -= ($nbrmodifcod8 * ($phrs_cnt + 1));
463 0 $lettre *= $nbrmodifcod9;
464 0 $lettre -= $nbrmodifcod10;
465 }
466  
467 0 ▶sub defdecalgo{
Subroutine defdecalgo: not called CC=1 SCAR=6.9
Pod undocumented
468 0 $lettre += $nbrmodifdec10;
469 0 $lettre /= $nbrmodifdec9;
470 0 $lettre += ($nbrmodifdec8 * ($phrs_cnt + 1));
471 0 $lettre /= $nbrmodifdec7;
472 0 $lettre += $nbrmodifdec6;
473 0 $lettre -= (($lettres_cnt + 1) * $nbrmodifdec5);
474 0 $lettre /= $nbrmodifdec4;
475 0 $lettre /= $nbrmodifdec3;
476 0 $lettre /= (($mots_cnt + 1) * $nbrmodifdec2);
477 0 $lettre -= $nbrmodifdec1;
478 }
479  
480 1 1;
↑ Summary