getsentry / sentry-rust

Official Sentry SDK for Rust
https://sentry.io/
Apache License 2.0
620 stars 153 forks source link

Use `rand` instead of `getrandom` for IDs #614

Closed Swatinem closed 1 year ago

Swatinem commented 1 year ago

The getrandom crate uses syscalls to get true randomness from the OS. We do not need that high quality of randomness, we do not even need cryptographically secure randomness.

This switches to the rand crate which uses a reseeding PRNG which is still cryptographically secure though.

This is much faster, and we can switch to an even simpler PRNG if it is not fast enough still.

codecov[bot] commented 1 year ago

Codecov Report

Merging #614 (539786b) into master (10c5640) will decrease coverage by 0.03%. Report is 1 commits behind head on master. The diff coverage is 93.75%.

:exclamation: Current head 539786b differs from pull request most recent head abc0ca6. Consider uploading reports for the commit abc0ca6 to get more accurate results

@@            Coverage Diff             @@
##           master     #614      +/-   ##
==========================================
- Coverage   73.14%   73.11%   -0.03%     
==========================================
  Files          57       58       +1     
  Lines        6583     6576       -7     
==========================================
- Hits         4815     4808       -7     
  Misses       1768     1768