Common algorithms.
Calculates a md4 hash.
Algorithms.md4(data);
var result = Algorithms.md4("some data"); //result == "a19fcbc49cf40331e8b7873f4700e1fd"
Calculates a md5 hash.
Algorithms.md5(data);
var result = Algorithms.md5("some data"); //result == "1e50210a0202497fb79bc38b6ade6c34"
Calculates a sha1 hash.
Algorithms.sha1(data);
var result = Algorithms.sha1("some data"); //result == "baf34551fecb48acc3da868eb85e1b6dac9de356"
Set the seed for the pseudorandom number generation.
Algorithms.setRandomSeed(seed);
Algorithms.setRandomSeed(42);
Returns the maximum integer value returned by randomInteger.
Algorithms.randomMax();
var result = Algorithms.randomMax();
Returns a random number between 0 and randomMax (inclusive) or between min and max (inclusive).
Algorithms.randomInteger();
Algorithms.randomInteger(min, max);
var result = Algorithms.randomInteger();
var result = Algorithms.randomInteger(0, 3);
Return a random decimal (floating) number between min and max (inclusive).
Algorithms.randomFloat(min, max);
var result = Algorithms.randomFloat(0.15, 3);
Generates a random string.
Algorithms.randomString({object});
var result1 = Algorithms.randomString(); var result2 = Algorithms.randomString({ characters: "abcdef" }); var result3 = Algorithms.randomString({ characters: "abcdef", minLength: 10, maxLength: 20 });