… | |
… | |
11 | |
11 | |
12 | One thing to note about this module is that it requires ISO C99 support, |
12 | One thing to note about this module is that it requires ISO C99 support, |
13 | both in your compiler and your standard library. If you don't have a |
13 | both in your compiler and your standard library. If you don't have a |
14 | compiler that supports ISO C, get gcc at http://gcc.gnu.org/ :) |
14 | compiler that supports ISO C, get gcc at http://gcc.gnu.org/ :) |
15 | |
15 | |
|
|
16 | $secs = estimate_time $size |
|
|
17 | Estimate the average time necessary to calculate a token of the |
|
|
18 | given size. |
|
|
19 | |
|
|
20 | See also "estimate_size". |
|
|
21 | |
|
|
22 | $size = estimate_size $time[, $min] |
|
|
23 | Estimate the size that can be calculated in the given time (which is |
|
|
24 | an upper bound). The function will not return a size less then |
|
|
25 | "min". |
|
|
26 | |
|
|
27 | Estimating the time to be used can go wrong by as much as 50% (but |
|
|
28 | is usually quite accurate), and the estimation itself can take as |
|
|
29 | much as a second on slower (<pentium) machines, but faster machines |
|
|
30 | (1Ghz P3 for example) usually handle it within a hundredth of a |
|
|
31 | second or so. |
|
|
32 | |
|
|
33 | The estimation will be done only once, so you can call this fucntion |
|
|
34 | as often as you like without incuring the overhead everytime. |
|
|
35 | |
16 | $cipher = new [param => value...] |
36 | $cipher = new [param => value...] |
17 | |
37 | |
18 | size => 20 + some |
38 | size => 18 |
19 | The number of collisions, in bits. Every bit increases the time |
39 | The number of collisions, in bits. Every bit increases the time |
20 | to create the token (and thus the cash) by two. |
40 | to create the token (and thus the cash) by two. |
21 | |
41 | |
22 | uid => "" |
42 | uid => "" |
23 | A string used to make the token more unique (e.g. the senders |
43 | A string used to make the token more unique (e.g. the senders |