CodeGuru Forums -
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic Newsletters VB Forums Developer.com


Newest CodeGuru.com Articles:

  • SQL Server Modeling Services with Microsoft Visual Studio 2010 Beta 2
  • Faltering Windows support
  • Internet Explorer 8 Click Clever Click Safe
  • Release Candidate 2 for ASP.NET MVC 2

  • Search CodeGuru:
     



    Go Back   CodeGuru Forums > General Discussion > Algorithms & Data Structures
    FAQ Members List Calendar Search Today's Posts Mark Forums Read

    Algorithms & Data Structures Discuss algorithms & data structures. Topics are not specific to any programming language.

     
     
    Thread Tools Search this Thread Rate Thread Display Modes
    Prev Previous Post   Next Post Next
      #1    
    Old September 6th, 2009, 11:58 AM
    Vogon5 Vogon5 is offline
    Junior Member
     
    Join Date: Sep 2009
    Posts: 1
    Vogon5 is an unknown quantity at this point (<10)
    Hashing keys into a 1-byte result with no collisions

    Hi all,

    I'm having trouble implementing a hash function that produces 1-byte hash values (ranging from 0-255) for variable length keys. I've tried the Generalized CRC and Pearson algorithms described here.

    While the CRC one works great, seemingly with no collisions based on my tests, it produces 4-byte hashes which are not very convenient for my purposes. Pearson gives me 1-byte hashes but I get around 60+ collisions in a 256-element key set (the keys are all unique) which is not very convenient either.

    Is there a way to either reduce a 4-byte hash value into a 1-byte hash while preserving the non-colliding-ness or make the Pearson algorithm to produce fewer collisions with 1-byte hashes?
    Reply With Quote
     

    Bookmarks
    Go Back   CodeGuru Forums > General Discussion > Algorithms & Data Structures


    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 12:10 PM.



    Acceptable Use Policy


    The Network for Technology Professionals

    Search:

    About Internet.com

    Legal Notices, Licensing, Permissions, Privacy Policy.
    Advertise | Newsletters | E-mail Offers


    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.