sethblack / javascript-fortuna

Javascript implementation of the Fortuna PRNG
Apache License 2.0
11 stars 3 forks source link

The advance example is wrong #7

Open dancespiele opened 6 years ago

dancespiele commented 6 years ago

I get a error when I try the advance example.

throw new fortuna.EntropyException(`entropyFxn needs to return either a string or array of length ${fortuna.entropySz} but you gave me ${typeof entropyTestValue} of length ${entropyTestValue.length}.`);
                                                                                                                                                                                                   ^

TypeError: Cannot read property 'length' of undefined
    at Object.fortuna.init (/home/spieljs/develop/random/node_modules/javascript-fortuna/lib/fortuna.js:40:196)
    at Object.<anonymous> (/home/spieljs/develop/random/testSi.js:31:9)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Function.Module.runMain (module.js:693:10)
    at startup (bootstrap_node.js:188:16)
    at bootstrap_node.js:609:3
dancespiele commented 6 years ago

the example works if you put the fortuna.init() inside of the settimeout