Fixed crypto.getRandomValues call for compatability