Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from May 27, 2021

Conversation

knolleary
Copy link
Member

Proposed changes

This PR changes the algorithm used to generate ids in the editor and runtime.

The existing code could produce variable length ids and had a . in the middle - which was accidental rather than intentional because all those years ago, I forgot to include Math.floor() in the code. eg bfc71766.923608

The new algorithm creates 8-byte fixed length ids without the . - eg 4ab59dd6503989b6. This gives us a range of 2^64 − 1 values - which is suitably random to avoid collisions within individual NR instances.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.007%) to 67.653% when pulling 8bbed2c on clean-ids into 6b43a23 on dev.

@knolleary knolleary merged commit 01b5fc4 into dev May 27, 2021
@knolleary knolleary deleted the clean-ids branch May 3, 2022 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Node-RED 2.0 Planning
Awaiting triage
Development

Successfully merging this pull request may close these issues.

None yet

2 participants