Merge pull request #2987 from node-red/clean-ids

Change node id generation to give fixed length values without '.'
This commit is contained in:
Nick O'Leary
2021-05-27 12:18:38 +01:00
committed by GitHub
5 changed files with 16 additions and 9 deletions

View File

@@ -210,8 +210,11 @@ RED.nodes = (function() {
})();
function getID() {
// return Math.floor(Math.random()*15728640 + 1048576).toString(16)
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("");
}
function parseNodePropertyTypeString(typeString) {