Change node id generation to give fixed length values without '.'

This commit is contained in:
Nick O'Leary
2021-05-18 11:32:17 +01:00
parent 6b43a23c4b
commit 8bbed2c831
5 changed files with 16 additions and 9 deletions

View File

@@ -31,7 +31,11 @@ const util = require("util");
* @memberof @node-red/util_util
*/
function generateId() {
return (1+Math.random()*4294967295).toString(16);
var bytes = [];
for (var i=0;i<8;i++) {
bytes.push(Math.round(0xff*Math.random()).toString(16).padStart(2,'0'));
}
return bytes.join("");
}
/**