Skip to content
This repository has been archived by the owner on Sep 21, 2022. It is now read-only.

Commit

Permalink
fix: bind getRandomValues to crypto
Browse files Browse the repository at this point in the history
Fixes errors when using some of the functions in a browser
  • Loading branch information
aldeed committed Apr 24, 2018
1 parent 00f4c2c commit be0e1c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ if (!crypto || !crypto.getRandomValues) {
}

const Random = new RandomGenerator({
getRandomValues: crypto && crypto.getRandomValues,
getRandomValues: crypto && crypto.getRandomValues && crypto.getRandomValues.bind(crypto),
seeds
});

Expand Down

0 comments on commit be0e1c1

Please sign in to comment.