Skip to content

Commit

Permalink
Merge pull request #538 from hypothesis/use-mscrypto-in-ie
Browse files Browse the repository at this point in the history
Use vendor-prefixed `msCrypto` property for IE 11
  • Loading branch information
seanh authored Sep 11, 2017
2 parents fa6bb5e + eb393fd commit 468e820
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/sidebar/util/random.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ function byteToHex(val) {
* @return {string}
*/
function generateHexString(len) {
var crypto = window.crypto || window.msCrypto /* IE 11 */;
var bytes = new Uint8Array(len / 2);
crypto.getRandomValues(bytes);
return Array.from(bytes).map(byteToHex).join('');
Expand Down

0 comments on commit 468e820

Please sign in to comment.