node-blink1-server
Version:
Standalone REST API server for blink(1) USB LED devices
12 lines (10 loc) • 414 B
JavaScript
;
module.exports = {
generateRandomHexColor: function() {
return '#' + Math.floor(Math.random() * 0xffffff).toString(16).toUpperCase();
},
generateRandomHostId: function() {
return ('000' + Math.floor(Math.random() * 0xffff).toString(16)).slice(-4).toUpperCase() +
('000' + Math.floor(Math.random() * 0xffff).toString(16)).slice(-4).toUpperCase();
},
};