Collision Probability
collision_probabilityDetermine the birthday-bound collision risk for a given number of items and hash bit width, helping you evaluate whether truncating a hash is safe.
Instructions
Birthday-bound hash collision probability: 1 - exp(-n^2 / (2*2^b)).
Sizes hashes: 1e6 items into 64 bits is ~2.7e-8; 1e5 into 32 bits is ~0.69 — the answer to 'can I truncate this to 8 hex chars?' (no).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bits | Yes | Width of the hash in bits, e.g. 32, 64, 128 | |
| items | Yes | Number of items being hashed |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||