How to use the seedrandom.xor4096 function in seedrandom

To help you get started, we’ve selected a few seedrandom examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tomlarkworthy / animaxe / dist / src / Parameter.js View on Github external
function __export(m) {
    for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
var seedrandom = require("seedrandom");
var OT = require("./frp");
var parametric = require("./parametric");
__export(require("./List"));
exports.DEBUG = false;
var types = require("./types");
__export(require("./types"));
if (exports.DEBUG)
    console.log("Parameter: module loading...");
exports.rndGenerator = seedrandom.xor4096(Math.random() + "");
// Parameter is a transformer from (clock signals -> Value)
/**
 * convert an Rx.Observable into a Parameter by providing an initial value. The Parameter's value will update its value
 * every time and event is received from the Rx source
 */
function updateFrom(initialValue, source) {
    if (exports.DEBUG)
        console.log("updateFrom: build");
    return new OT.SignalFn(function (upstream) {
        if (exports.DEBUG)
            console.log("updateFrom: init");
        var value = initialValue;
        source.subscribe(function (x) { return value = x; });
        return upstream.map(function (_) { return value; });
    });
}
github tomlarkworthy / animaxe / dist / src / Parameter.js View on Github external
return from(seed).mapValue(function (seed) {
        if (exports.DEBUG)
            console.log("seedrnd: seeding", seed);
        exports.rndGenerator = seedrandom.xor4096(seed);
        return;
    });
}

seedrandom

Seeded random number generator for Javascript.

MIT
Latest version published 5 years ago

Package Health Score

70 / 100
Full package analysis

Popular seedrandom functions