hash-prospector | Automated integer hash function discovery | Hashing library

 by   skeeto C Version: Current License: Unlicense

kandi X-RAY | hash-prospector Summary

kandi X-RAY | hash-prospector Summary

hash-prospector is a C library typically used in Security, Hashing applications. hash-prospector has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

Automated integer hash function discovery
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              hash-prospector has a low active ecosystem.
              It has 367 star(s) with 21 fork(s). There are 22 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 15 open issues and 5 have been closed. On average issues are closed in 3 days. There are 2 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of hash-prospector is current.

            kandi-Quality Quality

              hash-prospector has 0 bugs and 0 code smells.

            kandi-Security Security

              hash-prospector has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              hash-prospector code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              hash-prospector is licensed under the Unlicense License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              hash-prospector releases are not available. You will need to build from source code and install.
              Installation instructions are not available. 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 hash-prospector
            Get all kandi verified functions for this library.

            hash-prospector Key Features

            No Key Features are available at this moment for hash-prospector.

            hash-prospector Examples and Code Snippets

            No Code Snippets are available at this moment for hash-prospector.

            Community Discussions

            Trending Discussions on hash-prospector

            QUESTION

            Mixing function for non power of 2 integer intervals
            Asked 2019-Mar-27 at 14:24

            I'm looking for a mixing function that given an integer from an interval <0, n) returns a random-looking integer from the same interval. The interval size n will typically be a composite non power of 2 number. I need the function to be one to one. It can only use O(1) memory, O(1) time is strongly preferred. I'm not too concerned about randomness of the output, but visually it should look random enough (see next paragraph).

            I want to use this function as a pixel shuffling step in a realtime-ish renderer to select the order in which pixels are rendered (The output will be displayed after a fixed time and if it's not done yet this gives me a noisy but fast partial preview). Interval size n will be the number of pixels in the render (n = 1920*1080 = 2073600 would be a typical value). The function must be one to one so that I can be sure that every pixel is rendered exactly once when finished.

            I've looked at the reversible building blocks used by hash prospector, but these are mostly specific to power of 2 ranges.

            The only other method I could think of is multiply by large prime, but it doesn't give particularly nice random looking outputs.

            What are some other options here?

            ...

            ANSWER

            Answered 2019-Mar-27 at 14:24

            Here is one solution based on the idea of primitive roots modulo a prime:

            If a is a primitive root mod p then the function g(i) = a^i % p is a permutation of the nonzero elements which are less than p. This corresponds to the Lehmer prng. If n < p, you can get a permutation of 0, ..., n-1 as follows: Given i in that range, first add 1, then repeatedly multiply by a, taking the result mod p, until you get an element which is <= n, at which point you return the result - 1.

            To fill in the details, this paper contains a table which gives a series of primes (all of which are close to various powers of 2) and corresponding primitive roots which are chosen so that they yield a generator with good statistical properties. Here is a part of that table, encoded as a Python dictionary in which the keys are the primes and the primitive roots are the values:

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

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

            Vulnerabilities

            No vulnerabilities reported

            Install hash-prospector

            You can download it from GitHub.

            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
            CLONE
          • HTTPS

            https://github.com/skeeto/hash-prospector.git

          • CLI

            gh repo clone skeeto/hash-prospector

          • sshUrl

            git@github.com:skeeto/hash-prospector.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Hashing Libraries

            Try Top Libraries by skeeto

            endlessh

            by skeetoC

            w64devkit

            by skeetoC

            enchive

            by skeetoC

            branchless-utf8

            by skeetoC

            emacsql

            by skeetoC