Immediate-Mode-UI / Immediate-Mode-UI/Nuklear
Hashing: Use 64-bit hashes
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 11.4k
- Forks
- 686
- Avg merge
- 4d 1h
- Merged PRs (30d)
- 3
Description
Most if not all platforms use 64-bit registers now. 32-bit can still be used as it is sometimes a tiny bit faster or smaller in executable or saving bandwidth but in the case of hashes, I think it should use 64-bit. This avoids hash conflicts by reducing the chance of intersection by a lot.
Consider a big file tree and other objects in that dropdown. The chance of one of them intersecting if the hashes are not manually crafted is quite high. I've already noticed that the builtin hash function can cause conflicts; which I worked around by adding a "nk_tree_push_hashed" function. Though this still has to convert a 64 to a 32 bit int.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the built-in hash function and the nk_tree_push_hashed entry point mentioned in the issue, then trace where hashed UI identifiers are stored and narrowed to 32 bits. Done means the relevant hash path consistently supports 64-bit values and the existing collision concern is addressed without an unspecified conversion back to 32 bits.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100