-
Notifications
You must be signed in to change notification settings - Fork 166
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
重构: randx.RandCode 代码 #241
Conversation
dxyinme
commented
Jan 12, 2024
•
edited
Loading
edited
- 支持字符类型自由组合
- 增加对特殊字符的支持
- 增加函数RandStrByCharset,可以自定义字符集
- 增加对length小于0的异常处理
- 增加benchmark
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #241 +/- ##
==========================================
- Coverage 95.91% 95.79% -0.13%
==========================================
Files 66 66
Lines 3404 3424 +20
==========================================
+ Hits 3265 3280 +15
- Misses 108 110 +2
- Partials 31 34 +3 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我有一个小问题,就是有没有必要同时暴露 RandCode 和 RandStrCahrset 两个方法?
比如说,我不暴露 RandCode,我直接暴露 RandStrCharset,那么我直接用 RandStrCharset 会有什么问题吗?
不会有什么问题,RandCode的存在只是给RandStrByCharset做了一个封装,个人感觉还是可以保留的,为了给使用者带来方便,他们可以直接使用RandCode,而不需要自己拼凑字符集 |