We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 87c62f2 commit 9596418Copy full SHA for 9596418
index.js
@@ -756,7 +756,11 @@ util.createBuffer = function(input, encoding) {
756
*/
757
758
var prng = forge.prng = {};
759
-var crypto = null;
+
760
+var crypto;
761
+try {
762
+ crypto = require('crypto');
763
+} catch (_) {}
764
765
prng.create = function(plugin) {
766
var ctx = {
@@ -1005,7 +1009,7 @@ prng.create = function(plugin) {
1005
1009
// throw in more pseudo random
1006
1010
next = seed >>> (i << 3);
1007
1011
next ^= Math.floor(Math.random() * 0xFF);
1008
- b.putByte(String.fromCharCode(next & 0xFF));
1012
+ b.putByte(next & 0xFF);
1013
}
1014
1015
0 commit comments