Commit 1e5ae75
committed
Fix generateEventID to use crypto/rand without modulo bias
Replace randomString (which had modulo bias from int(v)%36 over a
256-byte range) with hex.EncodeToString of 8 crypto/rand bytes.
This produces a uniformly random 16-char hex suffix with no charset
mapping needed.
Co-authored-by: Isaac1 parent d1c5f09 commit 1e5ae75
1 file changed
Lines changed: 4 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
219 | 220 | | |
220 | 221 | | |
221 | 222 | | |
222 | | - | |
| 223 | + | |
223 | 224 | | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
| 225 | + | |
231 | 226 | | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
| 227 | + | |
236 | 228 | | |
0 commit comments