/usr/lib/nodejs/mess/index.js is in node-mess 0.1.2-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | (function(module) {
// see https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle
// and http://stackoverflow.com/questions/6274339/how-can-i-shuffle-an-array-in-javascript#6274398
module.exports = function shuffle(array) {
var counter = array.length,
temp,
index;
while (counter) {
index = Math.floor(Math.random() * counter--);
temp = array[counter];
array[counter] = array[index];
array[index] = temp;
}
return array;
}
})(module);
|