Yes, right now I want to make uuids by getting random numbers from 
window.crypto.getRandomValues. To generate good uuids without risk of 
collisions we need 128 bits of randomness, which the current random 
packages do not supply (they only supply 32, which is not enough).

It would be great to be able to do
port random : Int -> Task Never (List Int)

and in javascript do something like this:
app.ports.random.handle(function (n, callback) {
  var array = new Uint32Array(n);
  window.crypto.getRandomValues(array);
  callback(null, array);
});

Right now, I have to write a native function to make the task, or make two 
ports and subscribe and keep track of the random numbers somehow.

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to