Comments (1)
The hashing function operates on unsigned integers. Assuming hashing is uniform, this means the probability of any string being assigned to a particular hash value is 1/4294967296. This is just the Birthday Problem with 4294967296 buckets (rather than 365 buckets). Long-story short, the chance of having any collisions reaches 50% after 77,000 or so items.
In practice, hashing isn't uniform since this hashing function is based on a linear recurrence. It does pretty well but you can expect it to be worse for most inputs.
If you're in Node and you're working with large amounts of data, you might be better served by using one of the fast cryptographic hashes, like MD5.
from string-hash.
Related Issues (10)
- Converting signed to unsigned integers. HOT 1
- I found a collision with 70k strings T_T HOT 1
- Consider iterating over the string in forward direction HOT 3
- Improper implementation in the readme HOT 1
- Strange case insensitivity property HOT 3
- bump version number? HOT 3
- Could you please add license tag to package.json HOT 1
- no such file or directory, rename HOT 2
- possible to unhash? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from string-hash.