collision_probability
Calculate hash collision probability for n items and b bits, using the birthday-bound formula, to determine if 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 | ||
| items | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||