I have a Unicode / UTF-16 encoding . path separators are U + 005C '\'. Paths are paths to root relative window paths with zero completion, for example. "\ Windows \ system32 \ Drivers \ myDriver32.sys"
I want to pass this path to a 64-bit unsigned integer. For no cryptographic sounds required . Hashes must be case insensitive , but capable of handling letters other than ascii. Obviously, the hash should also change well.
There are some ideas that I had:
A) Using the Windows file identifier as a "hash". In my case, I want the hash to change if the file moves, so this is not an option.
B) Just use a regular hash of the hash: hash + = prime * hash + codepoint for the entire line.
I get the feeling that the fact that the path consists of "segements" (folder names and the final file name) can be used.
To summarize:
1) 64-bit hash
2) good distribution / multiple collisions for file system paths.
3) effective 4) no need to be safe
5) case insensitive
path collision hash-collision hash utf-16
Dominik weber
source share