Hash collisions
ayebear opened this issue · 1 comments
ayebear commented
Using the following component names: "A", "B", "A:B", the queries will break and mix the results of entities with A and B components with those of A:B components.
Possible solutions:
- Detect component names with ":", make them invalid and throw an error
- Escape the ":" characters with a backslash - then backslashes would have to be escaped as well
- Use a numeric hash format instead. Each new unique group of components would increment an integer. Or, each component type would double in size and act as a single positional bit, to efficiently allow any combination of components. Might start running into issues with 32 or 64 components though.
ayebear commented
Can fix this and all edge cases with JSON.stringify().