-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprogram.js
More file actions
43 lines (31 loc) · 1.28 KB
/
program.js
File metadata and controls
43 lines (31 loc) · 1.28 KB
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
/*------------- AUTHOR -------------*/
/*
STEPAN PESOUT
www.pesout.eu
stepan@pesout.eu
*/
/*-------- LIBRARIES LINKING --------*/
document.write('<script src="lib/bigint.js"></script>'); //http://github.com/peterolson/BigInteger.js
document.write('<script src="lib/countiny.js"></script>'); //http://github.com/pesout/countiny
document.write('<script src="lib/transfer.js"></script>'); //Numeral system transfer tool [transfer(tr_in, tr_in_r, tr_out_r)]
document.write('<script src="lib/table.js"></script>'); //Replacing functions [tab_in/tab_out]
document.write('<script src="lib/first_method.js"></script>'); //First method [first]
document.write('<script src="lib/statistics.js"></script>'); //Statistics displayer [stat]
/*------------- PROGRAM -------------*/
//Variables
var a = 0;
var b = 0;
var length_in = 0;
var length_out = 0;
var compressed = 0;
//Main function
function compression() {
length_in = document.formular.input.value.length; //For statistics
a = document.formular.input.value; //Replacing Base64 input with Oct number
a = tab_in(a); // [lib/table.js]
//Compression
a = first(a); //First method
//Statistics displaying and ending
document.formular.input.value = tab_out(a); //Replacing Oct number with Base64 code
stat(); //Statistics displaying
}