Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1099251
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T00:42:23+00:00 2026-05-17T00:42:23+00:00

I have a Unicode / UTF-16 encoded path . the path delimiters is U+005C

  • 0

I have a Unicode / UTF-16 encoded path. the path delimiters is U+005C ‘\’.
The paths are null-terminated root relative windows file system paths, e.g. “\windows\system32\drivers\myDriver32.sys”

I want to hash this path into a 64-bit unsigned integer.
It does not need to be “cryptographically sound”.
The hashes should be case insensitive, but able to handle non-ascii letters.
Obviously, the hash also should scatter well.

There are some ideas that I had though of:

A) Using the windows file identifier as a “hash”. In my case i do want the hash to change if the file gets moved, so this is not an option.

B) Just use a regular sting hash: hash += prime * hash + codepoint for the whole string.

I do have the feeling that the fact that the path consists of “segements” (folder names and the final file name) can be leveraged.

To sum up the needs:

1) 64bit hash
2) good distribution / few collisions for file system paths.
3) efficient
4) does not need to be secure
5) case insensitive

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T00:42:24+00:00Added an answer on May 17, 2026 at 12:42 am

    Cryptographically secure hashes might not be very efficient in terms of speed, but there are implementations available for virtually any programming language.
    Whether using them is feasible for your application depends on how much you depend on speed – a benchmark would give you an appropriate answer to that.

    You could use a sub-string of such a hash, e.g. MD5 on your path, previously converted to lower case so that the hash is effectively case-insensitive (requires that you use a method for lower-casing which knows how to convert all UTF-16 non-standard characters that may occur in the file system).

    Cryptographically secure hashes have the benefit of quite even distribution no matter which sub-string part you take because they are designed to be non-predictable, i.e. each part of the hash ideally depends on the entire hashed data as any other part of it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 537k
  • Answers 537k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer [:div {:style "background-color:#003366"} (escape-html rest)] Should do the trick. Might… May 17, 2026 at 1:40 am
  • Editorial Team
    Editorial Team added an answer My guess would be that perhaps the cache is full.… May 17, 2026 at 1:40 am
  • Editorial Team
    Editorial Team added an answer I think you are trying to descending sort by the… May 17, 2026 at 1:40 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have a list of strangely encoded files: 02 - Charlie, Woody and You/Study
Can someone confirm that Python 2.6 ftplib does NOT support Unicode file names? Or
I have a Python extension to the Nautilus file browser (AFAIK this runs exclusively
I have been studying unicode and its Python implementation now for two days, and
If I have a database containing only varchar columns, with strings encoded in Latin-1
I have a date import project in which the clients send ANSI-latin1 encoded files
I have a wide char string is Lhao123--我的上网主页, and it must be encoded to
Can UTF-8 encode 5 or 6 byte sequences, allowing all Unicode characters to be
Unicode simply assigns an integer to each character. UTF-8 or others are used to
I have a JSP page that handles file downloads. I set the response header

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.