Skip to content
This repository was archived by the owner on Jul 3, 2020. It is now read-only.

Commit 4d1f41f

Browse files
committed
Rename default-source to js-random source
1 parent 7ac99f8 commit 4d1f41f

3 files changed

Lines changed: 5 additions & 2 deletions

File tree

js/core/random/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ var EntropySource = require('./entropy-source');
1818
var sources = require('./sources');
1919
var typeutils = require('typeutils');
2020
var getDefaultSource = sources.getDefaultSource;
21-
require('./default-source');
21+
require('./js-random-source');
2222

2323
exports.EntropySource = EntropySource;
2424
exports.addEntropySource = sources.addEntropySource;
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ var isaac = require('./isaac-wrapper');
1717
var EntropySource = require('./entropy-source');
1818
var sources = require('./sources');
1919

20-
var source = new EntropySource('default');
20+
// Low quality entropy source based on Math.random() seed
21+
// and isaac CSPRNG
22+
var source = new EntropySource('js-random');
2123
source.ongetbytes = function(u8, cb) {
2224
for (var i = 0; i < u8.length; i++) {
2325
u8[i] = isaac.getByte();

js/core/random/sources.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ exports.addEntropySource = function(source) {
2121

2222
// Set this source as the default one
2323
defaultSource = source;
24+
console.log('[random] using entropy source', defaultSource.getName());
2425
};
2526

2627
exports.getDefaultSource = function() {

0 commit comments

Comments
 (0)