spookyhash | Thread safe and multi-endian version

 by   k0dai C Version: spookyhash-1.0.6 License: BSD-3-Clause

kandi X-RAY | spookyhash Summary

kandi X-RAY | spookyhash Summary

spookyhash is a C library. spookyhash has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

It’s fast. For short keys it’s 1 byte per cycle, with a 30 cycle startup cost. For long keys, well, it would be 3 bytes per cycle, and that only occupies one core. Except you’ll hit the limit of how fast uncached memory can be read, which on my home machines is less than 2 bytes per cycle. It’s good. It achieves avalanche for 1-bit and 2-bit inputs. It works for any type of key that can be made to look like an array of bytes, or list of arrays of bytes. It takes a seed, so it can produce many different independent hashes for the same key. It can produce up to 128-bit results. Large systems should consider using 128-bit checksums nowadays. A library with 4 billion documents is expected to have about 1 colliding 64-bit checksum no matter how good the hash is. Libraries using 128-bit checksums should expect 1 collision once they hit 16 quintillion documents. (Due to limited hardware, I can only verify SpookyHash is as good as a good 73-bit checksum. It might be better, I can’t tell.). When NOT to use it: if you have an opponent. This is not cryptographic. Given a message, a resourceful opponent could write a tool that would produce a modified message with the same hash as the original message. Once such a tool is written, a not-so-resourceful opponent could borrow the tool and do the same thing. Another case not to use it: CRCs have a nice property that you can split a message up into pieces arbitrarily, calculate the CRC all the pieces, then afterwards combine the CRCs for the pieces to find the CRC for the concatenation of all those pieces. SpookyHash can’t. If you could deterministically choose what the pieces were, though, you could compute the hashes for pieces with SpookyHash (or CityHash or any other hash), then treat those hash values as the raw data, and do CRCs on top of that.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              spookyhash has a low active ecosystem.
              It has 49 star(s) with 6 fork(s). There are 4 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 2 open issues and 2 have been closed. On average issues are closed in 0 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of spookyhash is spookyhash-1.0.6

            kandi-Quality Quality

              spookyhash has no bugs reported.

            kandi-Security Security

              spookyhash has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              spookyhash is licensed under the BSD-3-Clause License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              spookyhash releases are available to install and integrate.
              Installation instructions, examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of spookyhash
            Get all kandi verified functions for this library.

            spookyhash Key Features

            No Key Features are available at this moment for spookyhash.

            spookyhash Examples and Code Snippets

            Quick start
            Cdot img1Lines of Code : 19dot img1License : Permissive (BSD-3-Clause)
            copy iconCopy
            #include "spookyhash_api.h"
            
            void hash(void* data, size_t data_length) {
                uint64_t seed1 = 0xabcdef, seed2 = 0xfedcba;
                uint32_t seed3 = 0x12ab;
            
                // Direct use example
                spookyhash_128(data, data_length, &seed1, &seed2);            

            Community Discussions

            QUESTION

            Extract Spooky-hash 128 bit value from 2 uint64 values
            Asked 2019-Apr-23 at 16:16

            I am implementing Spooky-hash on one of the applications I am building.

            I am referencing the Golang and C libraries. These provide the output int the form of 2 unsigned 64bit integers.

            When looking at the python implementation (which is a wrapper on the C++) implementation they are deriving a 128 big number and giving back an answer.

            My problem is, what is python doing with the 2 64uint values to get this number?

            I think this is the relevant C++ code (from the python wrapper) where it invokes the original C++ library:

            ...

            ANSWER

            Answered 2019-Apr-23 at 11:34

            Convert those numbers to hex, and you will see the connection:

            Source https://stackoverflow.com/questions/55810139

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install spookyhash

            To build a static and dynamic library, as well as a test binary of SpookyHash on Windows, Linux or Mac OSX,. 1) Download [premake 5](http://premake.github.io/) and make it available in your path. 2) Run the following from the command line.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries

            Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link