2 * Contains utility functions
3 * @author Alessandro Pio Ardizio
7 const uuid
= require('uuid/v4')
9 * Return an id to be associated to a node.
11 module
.exports
.generateID
= () => {
15 module
.exports
.randomWorker
= (collection
) => {
16 const keys
= Array
.from(collection
.keys())
17 return keys
[Math
.floor(Math
.random() * keys
.length
)]