Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify message id generation and get rid of randnum #329

Conversation

wneessen
Copy link
Owner

@wneessen wneessen commented Oct 7, 2024

Updated the SetMessageID method to generate a "Message-ID" using a single randomly generated string combined with the hostname, replacing the prior complex format that included process ID and multiple random numbers. This change simplifies the code of the generated IDs as suggested in #327.

I also revised the character set to include a larger variety of symbols and adjusted the bit size calculations to correspond with the new set size. This ensures more efficient and secure random string generation by effectively utilizing the bitmask.

At the same time, the randNum functions and associated tests from random_119.go, random_121.go, and random_122.go have been deleted. These functions are no longer necessary. Additionally, replaced TestRandomNum and TestRandomNumZero with benchmarking for randomStringSecure.

This PR closes #327 and #326.

Removed `randNum` functions and associated tests from `random_119.go`, `random_121.go`, and `random_122.go`. These functions are no longer necessary. Additionally, replaced `TestRandomNum` and `TestRandomNumZero` with benchmarking for `randomStringSecure`.
Revised the character set to include a larger variety of symbols and adjusted the bit size calculations to correspond with the new set size. This ensures more efficient and secure random string generation by effectively utilizing the bitmask.
Updated the SetMessageID method to generate a "Message-ID" using a
single randomly generated string combined with the hostname, replacing
the prior complex format that included process ID and multiple random
numbers. This change simplifies the code of the generated IDs.
@wneessen wneessen linked an issue Oct 7, 2024 that may be closed by this pull request
Copy link

codecov bot commented Oct 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.85%. Comparing base (a94e721) to head (5874911).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #329      +/-   ##
==========================================
+ Coverage   86.81%   86.85%   +0.03%     
==========================================
  Files          27       26       -1     
  Lines        2359     2350       -9     
==========================================
- Hits         2048     2041       -7     
+ Misses        180      179       -1     
+ Partials      131      130       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@wneessen wneessen merged commit 8faac3d into main Oct 7, 2024
32 checks passed
@wneessen wneessen deleted the feature/327_simplify-message-id-generation-and-get-rid-of-randnum branch October 7, 2024 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Simplify message ID generation and get rid of randNum
1 participant