cityhash
SipHash
cityhash | SipHash | |
---|---|---|
2 | 3 | |
1,054 | 593 | |
1.2% | - | |
0.0 | 1.4 | |
almost 2 years ago | about 1 year ago | |
Shell | C | |
MIT License | Creative Commons Zero v1.0 Universal |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
cityhash
-
What hash function you use for hash maps / hash tables?
However, it's not the fastest. I found that Google CityHash was faster and produced slightly different hashvals. This was tested on billions of entries. https://github.com/google/cityhash
- Use Fast Data Algorithms
SipHash
-
does math.randomseed() let you use letters, or only numbers?
Very fast with security guarantees. These are faster than full cryptographic hashes and fulfill some but not all of the security guarantees. That's not to say that they're weaker, but that they're designed for certain usecases where they are perfectly adequate and others where they fail miserably. Example: SipHash2-4 https://github.com/veorq/SipHash
-
Implementing Hash Tables in C
Note that if you have untrusted input, you may want to use a defensive option for hashing involving a private key, such as SipHash[1]. Otherwise, an attacker who knows your hash functions can just pre-generate a large number of colliding elements and reduce your hash function to a linked list; given enough attacker-controlled elements, this can effectively amount to a DoS attack[2].
[1] https://github.com/veorq/SipHash
[2] https://www.aumasson.jp/siphash/siphashdos_29c3_slides.pdf
-
Getting unique items from a list. Why do they come out in a random order?
Sets are internally ordered by items' hash (rather, the first few bits of it, depending on the # of elements in the set), and strings are hashed with a pseudorandom algorithm.
What are some alternatives?
xxHash - Extremely fast non-cryptographic hash algorithm
OpenSSL - TLS/SSL and crypto library
BLAKE3 - the official Rust and C implementations of the BLAKE3 cryptographic hash function
Lua - Lua is a powerful, efficient, lightweight, embeddable scripting language. It supports procedural programming, object-oriented programming, functional programming, data-driven programming, and data description.
amazon-corretto-crypto-provider - The Amazon Corretto Crypto Provider is a collection of high-performance cryptographic implementations exposed via standard JCA/JCE interfaces.
OpenSSL - Swift OpenSSL for OS X and Linux
makeself - A self-extracting archiving tool for Unix systems, in 100% shell script.
Obfuscator-iOS - Secure your app by obfuscating all the hard-coded security-sensitive strings.
wyhash - The FASTEST QUALITY hash function, random number generators (PRNG) and hash map.
SwiftyRSA - RSA public/private key encryption in Swift
AES256CBC
upb - a small protobuf implementation in C