src/worker/worker.js
function randomCallback() {

  if (!randomQueue.length) {
    self.postMessage({ event: 'request-seed', amount: MAX_SIZE_RANDOM_BUFFER });
  }

  return new Promise(function(resolve) {
    randomQueue.push(resolve);
  });
}
function randomCallback() {

  if (!randomQueue.length) {
    self.postMessage({ event: 'request-seed', amount: MAX_SIZE_RANDOM_BUFFER });
  }

  return new Promise(function(resolve) {
    randomQueue.push(resolve);
  });
}
function randomCallback ( ) { if ( ! randomQueue . length ) { self . postMessage ( { event : 'request-seed' , amount : MAX_SIZE_RANDOM_BUFFER } ) ; } return new Promise ( function ( resolve ) { randomQueue . push ( resolve ) ; } ) ; }
Handle random buffer exhaustion by requesting more random bytes from the main window
@returns {Promise<Object>}  Empty promise whose resolution indicates that the buffer has been refilled
Handle random buffer exhaustion by requesting more random bytes from the main window