Re: ShortPathFilename in memory disk.



Ancient_Hacker wrote:

You can do that, the VFAT file system takes care of the 8.3 names
remaining unique.

If you're really strapped for space you could save some hash of the
long file name as 32 or 64 bits, that would be more compact and would
work with other file systems, like NTFS, that don't make short names.

One good hash algorithm is to add up all the characters, multiplying
the total by some prime (like 13) each time. Simple and you only risk
a 1 in 2^32 or 2^64 chance of collision.

Why add that extra step of multiplying? It takes time and onlymakes for a larger result to store...
.



Relevant Pages

  • Re: Difficulty manipulating hashes
    ... to the hash %dinucleotidescorepair and then sum the multiplied values ... of the hash all together to return the score. ... is about multiplying the values in a hash and summing the results. ... Posted Via Usenet.com Premium Usenet Newsgroup Services ...
    (comp.lang.perl.misc)
  • Re: hashCode() for Custom classes
    ... multiplying the intermediate sums by some prime number. ... int hash = 0; ... This doesn't guarantee no collisions, of course -- that'd be impossible ... For higher power hashing you can blend data into the linear congruential ...
    (comp.lang.java.programmer)
  • Re: hash
    ... Daniel J. Bernstein invented a very popular hash function, known as djb, which is just like the java string hash, but with a ... multiplying a binary number by them is like shifting it left five bits and then either adding or subtracting the original; that gives you five bits of diffusion, but keeps some influence of the original value over the bottom bit of the hash. ... Also, on machines which don't have a single-cycle multiply (there were RISC machines which didn't have a hardware multiply - you had to do shifts and adds; do they still exist?), it's quick, because it's just a shift and a subtract. ... NTK now entirely filled with google links -- NTK ...
    (comp.lang.java.programmer)
  • Re: hashCode() for Custom classes
    ... multiplying the intermediate sums by some prime number. ... int hash = 0; ... If zero was used as the initial value in step 1, ...
    (comp.lang.java.programmer)
  • Re: Two-stage hashing (pre-hash big integer -> hash-array-index)
    ... > hash value instead of the key to generate the probe sequence. ... avoid all hashes with same home index following same collision chain, ... are the same will follow exactly the same collision chain. ... computes what I call the pre-hash, the large unsigned integer, from the ...
    (comp.programming)