in reply to Re^3: Generating Unique numbers from Unique strings
in thread Generating Unique numbers from Unique strings

Thanks Hauke. For me is 200000 strings per run of the program. Agree with your statements..

From all the responses looks like traditional hashes should do the job. Anyways let me check the speed impact.

As you rightly said it is science :) Appreciate your time and advices.

I will try out the suggestions.. Good Day!

  • Comment on Re^4: Generating Unique numbers from Unique strings

Replies are listed 'Best First'.
Re^5: Generating Unique numbers from Unique strings
by haukex (Archbishop) on Apr 05, 2016 at 21:51 UTC

    Hi rjohn1,

    I should probably add that what I said about algorithms mapping strings to 32-bit numbers applies to hashing/checksumming functions. There may be other algorithms or data structures that could be used to check incoming strings for matches against an existing set of strings (like a tree structure, maybe trie), but that's not my area of expertise. But I'd still try Perl's hashes first, at the very least to get a quick prototype implementation or a baseline, but it may very well turn out they'll be good enough for you.

    Regards,
    -- Hauke D