-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
54 lines (45 loc) · 1.01 KB
/
index.js
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
var twc = require('./tokenwizard.js');
twc.init(32);
twc.connect();
/*
twc.invalidate("xya0baHvB2Nwx44xSWrkWtmyompvGGnlgY4Ken", function (err) {
});
twc.get_token("hn6QaaoPxoqvhD6VSvkP0SoYv7xMjCEemJh1JT", function (err, data) {
if(!err)
console.log(data.toString('ascii'));
});
*/
var i = 1;
var foo;
foo = function () {
/*
twc.get_token("4ytyba4fh2gBVgRT0FF2MbflUoAtKixsBrM3s0", function (err, data) {
if(!err)
++i;//console.log(data.toString('ascii'));
});
/**/
twc.gen_token(Buffer.from("12345", 'ascii'), 5, function (err, data) {
if(!err)
{
//console.log(data.toString('ascii'));
++i;
}
else
console.log("Threre is no token!");
});
/**/
setImmediate(foo);
};
foo();
/*
*/
var benchmark;
benchmark = function() {
console.log(i);
//i = 0;
setTimeout(benchmark, 1000);
};
benchmark();
function randomInt (low, high) {
return Math.floor(Math.random() * (high - low) + low);
}