Hash function of structs

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Alexander Mahone

    Hash function of structs

    Hello, I'm looking for an hash function to be used for an hash table
    that will contain structs of a certain kind. I've looked into
    Sourceforge.net , but so far I've found only hash functions for strings
    (string->index)...Do you know if there exist such a function
    somewhere?
    Thanks
  • CBFalconer

    #2
    Re: Hash function of structs

    Alexander Mahone wrote:
    >
    Hello, I'm looking for an hash function to be used for an hash
    table that will contain structs of a certain kind. I've looked
    into Sourceforge.net , but so far I've found only hash functions
    for strings (string->index)...Do you know if there exist such a
    function somewhere?
    Try: <http://cbfalconer.home .att.net/download/hashlib.zip>

    Written in standard C, and released under GPL.

    --
    [mail]: Chuck F (cbfalconer at maineline dot net)
    [page]: <http://cbfalconer.home .att.net>
    Try the download section.


    ** Posted from http://www.teranews.com **

    Comment

    • Pietro Cerutti

      #3
      Re: Hash function of structs

      CBFalconer wrote:
      Alexander Mahone wrote:
      >Hello, I'm looking for an hash function to be used for an hash
      >table that will contain structs of a certain kind. I've looked
      >into Sourceforge.net , but so far I've found only hash functions
      >for strings (string->index)...Do you know if there exist such a
      >function somewhere?
      >
      Try: <http://cbfalconer.home .att.net/download/hashlib.zip>
      >
      Written in standard C, and released under GPL.
      >
      Nice, would you mind to double-license it under BSD, or would you take
      it into consideration on a per-project basis?

      --
      Pietro Cerutti

      Comment

      • Dann Corbit

        #4
        Re: Hash function of structs

        "Pietro Cerutti" <gahr@gahr.chwr ote in message
        news:VdGdnV6mNe uc8azVnZ2dnUVZ8 tzinZ2d@giganew s.com...
        CBFalconer wrote:
        >Alexander Mahone wrote:
        >>Hello, I'm looking for an hash function to be used for an hash
        >>table that will contain structs of a certain kind. I've looked
        >>into Sourceforge.net , but so far I've found only hash functions
        >>for strings (string->index)...Do you know if there exist such a
        >>function somewhere?
        >>
        >Try: <http://cbfalconer.home .att.net/download/hashlib.zip>
        >>
        >Written in standard C, and released under GPL.
        >>
        >
        Nice, would you mind to double-license it under BSD, or would you take it
        into consideration on a per-project basis?
        When you want to find a specific tool with specific requirements (like a BSD
        licensed hash table in C) the first place I would look would be sourceforge.

        Download uthash for free. This is a hash table, implemented in C, supporting constant-time add/find/remove of C structures. Any structure having a unique, arbitrarily-typed key member can be hashed by adding a UT_hash_handle member to the structure and calling these macros.



        ** Posted from http://www.teranews.com **

        Comment

        • Pietro Cerutti

          #5
          Re: Hash function of structs

          Dann Corbit wrote:
          "Pietro Cerutti" <gahr@gahr.chwr ote in message
          news:VdGdnV6mNe uc8azVnZ2dnUVZ8 tzinZ2d@giganew s.com...
          >CBFalconer wrote:
          >>Alexander Mahone wrote:
          >>>Hello, I'm looking for an hash function to be used for an hash
          >>>table that will contain structs of a certain kind. I've looked
          >>>into Sourceforge.net , but so far I've found only hash functions
          >>>for strings (string->index)...Do you know if there exist such a
          >>>function somewhere?
          >>Try: <http://cbfalconer.home .att.net/download/hashlib.zip>
          >>>
          >>Written in standard C, and released under GPL.
          >>>
          >Nice, would you mind to double-license it under BSD, or would you take it
          >into consideration on a per-project basis?
          >
          When you want to find a specific tool with specific requirements (like a BSD
          licensed hash table in C) the first place I would look would be sourceforge.
          >
          http://sourceforge.net/projects/uthash/
          I wasn't actually looking for such a tool... just asking myself about
          Charles' view on licensing..

          Actually, we (me first) are being off-topic.


          --
          Pietro Cerutti

          Comment

          • CBFalconer

            #6
            Re: Hash function of structs

            Pietro Cerutti wrote:
            CBFalconer wrote:
            >Alexander Mahone wrote:
            >>
            >>Hello, I'm looking for an hash function to be used for an hash
            >>table that will contain structs of a certain kind. I've looked
            >>into Sourceforge.net , but so far I've found only hash functions
            >>for strings (string->index)...Do you know if there exist such a
            >>function somewhere?
            >>
            >Try: <http://cbfalconer.home .att.net/download/hashlib.zip>
            >>
            >Written in standard C, and released under GPL.
            >
            Nice, would you mind to double-license it under BSD, or would you
            take it into consideration on a per-project basis?
            I have never studied the BSD licence, so I don't know. I will
            release it to specific projects under individual agreements (and
            payments) so it is available where you don't want to release your
            source code.

            There are some minor difficulties with compiling and testing under
            Unix. Just to do with the makefiles, etc.

            --
            [mail]: Chuck F (cbfalconer at maineline dot net)
            [page]: <http://cbfalconer.home .att.net>
            Try the download section.


            ** Posted from http://www.teranews.com **

            Comment

            • CBFalconer

              #7
              Re: Hash function of structs

              Dann Corbit wrote:
              "Pietro Cerutti" <gahr@gahr.chwr ote in message
              >CBFalconer wrote:
              >>Alexander Mahone wrote:
              >>>
              >>>Hello, I'm looking for an hash function to be used for an hash
              >>>table that will contain structs of a certain kind. I've looked
              >>>into Sourceforge.net , but so far I've found only hash functions
              >>>for strings (string->index)...Do you know if there exist such a
              >>>function somewhere?
              >>>
              >>Try: <http://cbfalconer.home .att.net/download/hashlib.zip>
              >>>
              >>Written in standard C, and released under GPL.
              >>
              >Nice, would you mind to double-license it under BSD, or would
              >you take it into consideration on a per-project basis?
              >
              When you want to find a specific tool with specific requirements
              (like a BSD licensed hash table in C) the first place I would look
              would be sourceforge.
              Why? I, and others, release some of our packages on our own pages,
              under our own conditions (such as GPL). I suspect you will find
              hashlib better than anything on sourceforge (but I could be
              wrong). The problem is the finding.

              --
              [mail]: Chuck F (cbfalconer at maineline dot net)
              [page]: <http://cbfalconer.home .att.net>
              Try the download section.


              ** Posted from http://www.teranews.com **

              Comment

              • Antoninus Twink

                #8
                Re: Hash function of structs

                On 19 May 2008 at 20:39, CBFalconer wrote:
                I suspect you will find hashlib better than anything on sourceforge
                Words fail me. That must surely rank as the most arrogant statement I've
                ever read on Usenet by a country mile, and that's saying something.
                Simply incredible.

                Comment

                • Eligiusz Narutowicz

                  #9
                  Re: Hash function of structs

                  CBFalconer <cbfalconer@yah oo.comwrites:
                  Dann Corbit wrote:
                  >"Pietro Cerutti" <gahr@gahr.chwr ote in message
                  >>CBFalconer wrote:
                  >>>Alexander Mahone wrote:
                  >>>>
                  >>>>Hello, I'm looking for an hash function to be used for an hash
                  >>>>table that will contain structs of a certain kind. I've looked
                  >>>>into Sourceforge.net , but so far I've found only hash functions
                  >>>>for strings (string->index)...Do you know if there exist such a
                  >>>>function somewhere?
                  >>>>
                  >>>Try: <http://cbfalconer.home .att.net/download/hashlib.zip>
                  >>>>
                  >>>Written in standard C, and released under GPL.
                  >>>
                  >>Nice, would you mind to double-license it under BSD, or would
                  >>you take it into consideration on a per-project basis?
                  >>
                  >When you want to find a specific tool with specific requirements
                  >(like a BSD licensed hash table in C) the first place I would look
                  >would be sourceforge.
                  >
                  Why? I, and others, release some of our packages on our own pages,
                  under our own conditions (such as GPL). I suspect you will find
                  hashlib better than anything on sourceforge (but I could be
                  wrong). The problem is the finding.
                  You are very wrong. Your hashlib is very primitive. There are much
                  better offering things in various packages on source forge.

                  Comment

                  • user923005

                    #10
                    Re: Hash function of structs

                    On May 19, 1:39 pm, CBFalconer <cbfalco...@yah oo.comwrote:
                    Dann Corbit wrote:
                    "Pietro Cerutti" <g...@gahr.chwr ote in message
                    CBFalconer wrote:
                    >Alexander Mahone wrote:
                    >
                    >>Hello, I'm looking for an hash function to be used for an hash
                    >>table that will contain structs of a certain kind. I've looked
                    >>into Sourceforge.net , but so far I've found only hash functions
                    >>for strings (string->index)...Do you know if there exist such a
                    >>function somewhere?
                    >
                    >Try:  <http://cbfalconer.home .att.net/download/hashlib.zip>
                    >
                    >Written in standard C, and released under GPL.
                    >
                    Nice, would you mind to double-license it under BSD, or would
                    you take it into consideration on a per-project basis?
                    >
                    When you want to find a specific tool with specific requirements
                    (like a BSD licensed hash table in C) the first place I would look
                    would be sourceforge.
                    >
                    Why?  I, and others, release some of our packages on our own pages,
                    under our own conditions (such as GPL).  I suspect you will find
                    hashlib better than anything on sourceforge (but I could be
                    wrong).  The problem is the finding.
                    I think you are not very familiar with sourceforge. For example:

                    The PostgreSQL database is hosted on Sourceforge. It has dozens of
                    active developers and commercial support from several large
                    corporations. It is a highly advanced object/relational database with
                    performance on part with the top commercial systems and yet it is
                    Berkeley licensed.

                    I suggest an hour of browsing around over there might give you quite a
                    surprise about the quality of the available software. It is true that
                    some of it is not worth the powder to blow it up with. But that stuff
                    is quite easy to recognize.


                    Comment

                    • CBFalconer

                      #11
                      Re: Hash function of structs

                      Eligiusz Narutowicz wrote:
                      CBFalconer <cbfalconer@yah oo.comwrites:
                      >Dann Corbit wrote:
                      >>"Pietro Cerutti" <gahr@gahr.chwr ote in message
                      >>>CBFalconer wrote:
                      >>>>
                      .... snip ...
                      >>>>>
                      >>>>Try: <http://cbfalconer.home .att.net/download/hashlib.zip>
                      >>>>>
                      >>>>Written in standard C, and released under GPL.
                      >>>>
                      >>>Nice, would you mind to double-license it under BSD, or would
                      >>>you take it into consideration on a per-project basis?
                      >>>
                      >>When you want to find a specific tool with specific requirements
                      >>(like a BSD licensed hash table in C) the first place I would look
                      >>would be sourceforge.
                      >>
                      >Why? I, and others, release some of our packages on our own pages,
                      >under our own conditions (such as GPL). I suspect you will find
                      >hashlib better than anything on sourceforge (but I could be
                      >wrong). The problem is the finding.
                      >
                      You are very wrong. Your hashlib is very primitive. There are much
                      better offering things in various packages on source forge.
                      You are a troll, and have no knowledge of these things.

                      --
                      [mail]: Chuck F (cbfalconer at maineline dot net)
                      [page]: <http://cbfalconer.home .att.net>
                      Try the download section.


                      ** Posted from http://www.teranews.com **

                      Comment

                      • Harald van =?UTF-8?b?RMSzaw==?=

                        #12
                        Re: Hash function of structs

                        On Tue, 20 May 2008 15:24:48 -0400, CBFalconer wrote:
                        Eligiusz Narutowicz wrote:
                        >CBFalconer <cbfalconer@yah oo.comwrites:
                        >>I suspect you will find
                        >>hashlib better than anything on sourceforge (but I could be wrong).
                        >>The problem is the finding.
                        >>
                        >You are very wrong. Your hashlib is very primitive. There are much
                        >better offering things in various packages on source forge.
                        >
                        You are a troll, and have no knowledge of these things.
                        Calling anyone a troll for suggesting your hashlib is not the best
                        hashlib in the world is an extremely poor way to be taken seriously, if
                        you ask me.

                        Comment

                        • Eligiusz Narutowicz

                          #13
                          Re: Hash function of structs

                          Harald van Dijk <truedfx@gmail. comwrites:
                          On Tue, 20 May 2008 15:24:48 -0400, CBFalconer wrote:
                          >Eligiusz Narutowicz wrote:
                          >>CBFalconer <cbfalconer@yah oo.comwrites:
                          >>>I suspect you will find
                          >>>hashlib better than anything on sourceforge (but I could be wrong).
                          >>>The problem is the finding.
                          >>>
                          >>You are very wrong. Your hashlib is very primitive. There are much
                          >>better offering things in various packages on source forge.
                          >>
                          >You are a troll, and have no knowledge of these things.
                          >
                          Calling anyone a troll for suggesting your hashlib is not the best
                          hashlib in the world is an extremely poor way to be taken seriously, if
                          you ask me.
                          Someone explains already better than my English could do about what is
                          on source forge. I find this CBFalconer to be a bit of a big head and
                          more wrong than right in his postings to these groups. There are many of
                          projects in source forge which contain code from far better programmers
                          than CBFalconer is every wanting to be capable of. And for wider issues
                          than he can imagine. I have seen his code and it is not of the best
                          calibre to be honest with you. It is ok for sure but is not of the
                          commercial types found in source forge projects like rdbms sw.


                          Comment

                          • CBFalconer

                            #14
                            Re: Hash function of structs

                            user923005 wrote:
                            CBFalconer <cbfalco...@yah oo.comwrote:
                            >Dann Corbit wrote:
                            >>"Pietro Cerutti" <g...@gahr.chwr ote in message
                            >>>CBFalconer wrote:
                            >>>>
                            .... snip ...
                            >>>>
                            >>>>Try: <http://cbfalconer.home .att.net/download/hashlib.zip>
                            >>>>>
                            >>>>Written in standard C, and released under GPL.
                            >>>>
                            >>>Nice, would you mind to double-license it under BSD, or would
                            >>>you take it into consideration on a per-project basis?
                            >>>
                            >>When you want to find a specific tool with specific requirements
                            >>(like a BSD licensed hash table in C) the first place I would look
                            >>would be sourceforge.
                            >>
                            >Why? I, and others, release some of our packages on our own pages,
                            >under our own conditions (such as GPL). I suspect you will find
                            >hashlib better than anything on sourceforge (but I could be
                            >wrong). The problem is the finding.
                            >
                            I think you are not very familiar with sourceforge. For example:
                            >
                            .... snip ...
                            >
                            I suggest an hour of browsing around over there might give you
                            quite a surprise about the quality of the available software. It
                            is true that some of it is not worth the powder to blow it up with.
                            But that stuff is quite easy to recognize.
                            I'm sure you are correct about my failings. However, have you ever
                            investigated hashlib? I wrote it in 2002, and it is essentially
                            unchanged since. Partially because I cannot think of expansions
                            that will not harm its portability. The details about 'what is the
                            data' are entirely isolated, as are the actual hash functions
                            (which depend on the data). However no attention need be paid to
                            such things as table size. It has a delete function. It has a
                            mechanism for walking the entire data base.

                            By the way, 'isolated data' above means the package doesn't care.
                            You define a structure that holds the data, and create routines to
                            copy the data into such a malloced area, you define a comparison
                            routine that checks that two data structure are identical, etc.
                            The only fault I can find is that it is not thread-safe, but you
                            can hide calls to routines behing suitable locking functions if you
                            wish.

                            --
                            [mail]: Chuck F (cbfalconer at maineline dot net)
                            [page]: <http://cbfalconer.home .att.net>
                            Try the download section.

                            ** Posted from http://www.teranews.com **

                            Comment

                            • CBFalconer

                              #15
                              Re: Hash function of structs

                              Eligiusz Narutowicz wrote:
                              Harald van Dijk <truedfx@gmail. comwrites:
                              >CBFalconer wrote:
                              >>Eligiusz Narutowicz wrote:
                              >>>CBFalconer <cbfalconer@yah oo.comwrites:
                              >>>>
                              >>>>I suspect you will find hashlib better than anything on
                              >>>>sourcefor ge (but I could be wrong). The problem is the finding.
                              >>>>
                              >>>You are very wrong. Your hashlib is very primitive. There are
                              >>>much better offering things in various packages on source forge.
                              >>>
                              >>You are a troll, and have no knowledge of these things.
                              >>
                              >Calling anyone a troll for suggesting your hashlib is not the best
                              >hashlib in the world is an extremely poor way to be taken
                              >seriously, if you ask me.
                              True enough. I lost my head at the idiotic comment. EN has
                              obviously never read and/or used hashlib.
                              >
                              Someone explains already better than my English could do about
                              what is on source forge. I find this CBFalconer to be a bit of
                              a big head and more wrong than right in his postings to these
                              groups. There are many of projects in source forge which contain
                              code from far better programmers than CBFalconer is every wanting
                              to be capable of. And for wider issues than he can imagine. I
                              have seen his code and it is not of the best calibre to be honest
                              with you. It is ok for sure but is not of the commercial types
                              found in source forge projects like rdbms sw.
                              Similarly your comments above. When you can't make specific
                              complaints, the comment is totally worthless. For example, I tried
                              to take a look at:

                              <http://sourceforge.net/projects/uthash/>

                              recommended by Dann Corbit a while back. That turns out to be a
                              non-portable system (it depends on Posix) implemented by macros. I
                              couldn't find a way to access any documentation on it. Hashlib is
                              a LIBRARY, very compact (multiple data-bases don't require multiple
                              loads of the library) and well isolated. It is written in purely
                              standard C, so it is extremly portable. After linking to it you
                              can't get at the critical data to foul it up with legitimate code.

                              --
                              [mail]: Chuck F (cbfalconer at maineline dot net)
                              [page]: <http://cbfalconer.home .att.net>
                              Try the download section.

                              ** Posted from http://www.teranews.com **

                              Comment

                              Working...