Commit 468e820e authored by Sean Hammond's avatar Sean Hammond Committed by GitHub

Merge pull request #538 from hypothesis/use-mscrypto-in-ie

Use vendor-prefixed `msCrypto` property for IE 11
parents fa6bb5e2 eb393fda
...@@ -14,6 +14,7 @@ function byteToHex(val) { ...@@ -14,6 +14,7 @@ function byteToHex(val) {
* @return {string} * @return {string}
*/ */
function generateHexString(len) { function generateHexString(len) {
var crypto = window.crypto || window.msCrypto /* IE 11 */;
var bytes = new Uint8Array(len / 2); var bytes = new Uint8Array(len / 2);
crypto.getRandomValues(bytes); crypto.getRandomValues(bytes);
return Array.from(bytes).map(byteToHex).join(''); return Array.from(bytes).map(byteToHex).join('');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment